Keyboard layout changer
The keyboard layout changer is a simple tool to easily change keyboard layout. Possible uses are for typing in a different language on your Pandora, for using an external keyboard, or simply for making small key modifications.
Contents |
Usage guide
- Download the PND to your Pandora from either Slaeshjag's site or from the Repo (see here for instructions on where to place PNDs)
- Run the PND; it's called "Keyboard Layout" and is in the "Settings" category
- You will now see a choice of keyboard layouts. Choose one, and your layout will change!
(if the program doesn't run, find the/tmp/pndrun_kblayout.outfile and post its contents in the official forum thread, so that the author can see what went wrong)
Making your own custom keyboard layouts
- Go to the
/media/yourSDcard/pandora/appdata/kblayout/keymapsdirectory. Inside, you will see a bunch of files. Open any one with a text editor, and you'll see something like this:
./setxkbmap -layout us xmodmap ~/.pndXmodmap
What this means is that it's using the "us" layout with the modifications specified in the ".pndXmodmap" file (the Pandora needs these modifications because its keyboard isn't the same as a standard one).
So there are two basic things you could change: you could replace "us" with a different base layout, or you could replace "~/.pndXmodmap" with a different file.
Base layouts
The default layout is "us". The full list of base layouts included with the Pandora is listed in the file /usr/share/X11/xkb/keymap/xfree86. Here's the full list:
us ar be bg br cz de ch_de ch_fr dk dvorak en_US es fr fr-latin9 fr_CA gb hr it jp106 lt lt_std lv mk mt no pl pt ro ro_microsoft ru se_FI se_SE sl sl_SI sk syr th th_tis th_pat tr uk us_flexpro us_intl us_microsoft uz cz_qwerty de_CH fr_CH mt_us sk_qwerty
If you just want to use one of these base layouts with no modifications, make a new file in the /media/yourSDcard/pandora/appdata/kblayout/keymaps directory, name it anything, open it in a text editor and place the following text inside, replacing "xx" with any of the codes in the above list:
./setxkbmap -layout xx
Save the file. Then just start Keyboard Layout Changer, and you'll be able to select it.
xmodmap
This type of file modifies whatever base layout is selected. One of these comes by default with your Pandora OS. You can find the .pndXmodmap file in the /home/username directory. It might be hidden, so press Ctrl+H to make it visible. If you open it with a text editor, you'll see this:
keycode 9 = Escape NoSymbol Escape keycode 10 = 1 section 1 section keycode 11 = 2 braceleft 2 braceleft keycode 12 = 3 braceright 3 braceright keycode 13 = 4 asciitilde 4 asciitilde keycode 14 = 5 percent 5 percent keycode 15 = 6 asciicircum 6 asciicircum keycode 16 = 7 ampersand 7 ampersand keycode 17 = 8 asterisk 8 asterisk keycode 18 = 9 bracketleft 9 bracketleft keycode 19 = 0 bracketright 0 bracketright keycode 22 = BackSpace Delete BackSpace Delete keycode 24 = q Q q Q keycode 25 = w W w W keycode 26 = e E e E keycode 27 = r R r R keycode 28 = t T t T keycode 29 = y Y y Y keycode 30 = u U u U keycode 31 = i I i I keycode 32 = o O o O keycode 33 = p P p P keycode 34 = parenleft NoSymbol parenleft keycode 35 = parenright NoSymbol parenright keycode 36 = Return Multi_key Return keycode 37 = Control_L NoSymbol Control_L keycode 38 = a A a A keycode 39 = s S s S keycode 40 = d D d D keycode 41 = f F f F keycode 42 = g G g G keycode 43 = h H h H keycode 44 = j J j J keycode 45 = k K k K keycode 46 = l L l L keycode 47 = semicolon NoSymbol semicolon keycode 48 = apostrophe NoSymbol apostrophe keycode 49 = grave NoSymbol grave keycode 50 = Shift_L NoSymbol Shift_L keycode 52 = z Z z Z keycode 53 = x X x X keycode 54 = c C c C keycode 55 = v V v V keycode 56 = b B b B keycode 57 = n N n N keycode 58 = m M m M keycode 59 = comma less comma less keycode 60 = period greater period greater keycode 61 = slash NoSymbol slash keycode 62 = Shift_R NoSymbol Shift_R keycode 64 = Alt_L NoSymbol Alt_L keycode 65 = space NoSymbol space keycode 66 = Caps_Lock NoSymbol Caps_Lock keycode 67 = F1 NoSymbol F1 keycode 68 = F2 NoSymbol F2 keycode 69 = F3 NoSymbol F3 keycode 70 = F4 NoSymbol F4 keycode 71 = F5 NoSymbol F5 keycode 72 = F6 NoSymbol F6 keycode 73 = F7 NoSymbol F7 keycode 74 = F8 NoSymbol F8 keycode 75 = F9 NoSymbol F9 keycode 76 = F10 NoSymbol F10 keycode 82 = minus NoSymbol minus NoSymbol keycode 83 = Home quotedbl Home quotedbl keycode 86 = plus NoSymbol plus NoSymbol keycode 87 = Prior Multi_key Prior Multi_key keycode 88 = End XF86_Switch_VT_2 End XF86_Switch_VT_2 keycode 89 = Next XF86_Switch_VT_1 Next XF86_Switch_VT_1 keycode 95 = F11 NoSymbol F11 keycode 96 = F12 NoSymbol F12 keycode 118 = Insert NoSymbol Insert keycode 132 = yen NoSymbol yen keycode 187 = parenleft NoSymbol parenleft keycode 188 = parenright NoSymbol parenright keycode 191 = acute NoSymbol acute keycode 192 = bar NoSymbol bar keycode 193 = underscore NoSymbol underscore keycode 194 = numbersign NoSymbol numbersign keycode 195 = exclam NoSymbol exclam keycode 196 = sterling NoSymbol sterling keycode 197 = quotedbl NoSymbol quotedbl keycode 198 = at NoSymbol at keycode 199 = colon NoSymbol colon keycode 200 = dollar NoSymbol dollar keycode 201 = EuroSign NoSymbol EuroSign keycode 222 = question NoSymbol question keycode 235 = Tab NoSymbol Tab
Ok, now let's break this down a little. keycode 38 = a A a A - the first two letters after the = sign are what you'll get if you press the button marked A with and without holding "shift". The next two are with and without shift modifier together with a second modifier, but since there's no second modifier on the Pandora, this is redundant really. What about Fn, you may ask, isn't that a second modifier? The Fn-key acts on a lower level, and is not seen as a separate key. Instead, there are separate keycode entries for all Fn keys (the ones marked in blue on your Pandora). "NoSymbol" means that the combination doesn't produce a character. You can find a full list of symbols (or "keysyms") that you can use over here.
You can edit the .pndXmodmap file itself if you want to. That'll change the default keyboard layout you have at startup.
But you can also make secondary custom keyboard layouts.
For example, here's how to make a selectable custom Russian keyboard layout:
Making a custom Russian keyboard layout
Make two new files inside /media/yourSDcard/pandora/appdata/kblayout/keymaps. One called "RU-translit" (the name doesn't matter), one called ".rumodmap" (the dot at the start of the name is to make it not show up in the Keyboard Layout Changer menu as a keymap; that's the function of the first file you made). Put this text in the RU-translit file:
./setxkbmap -layout us xmodmap keymaps/.rumodmap
Put this text in the .rumodmap file:
keycode 9 = Escape NoSymbol Escape keycode 10 = 1 section 1 section keycode 11 = 2 braceleft 2 braceleft keycode 12 = 3 braceright 3 braceright keycode 13 = 4 asciitilde 4 asciitilde keycode 14 = 5 percent 5 percent keycode 15 = 6 asciicircum 6 asciicircum keycode 16 = 7 ampersand 7 ampersand keycode 17 = 8 asterisk 8 asterisk keycode 18 = 9 bracketleft 9 bracketleft keycode 19 = 0 bracketright 0 bracketright keycode 22 = BackSpace Delete BackSpace Delete keycode 24 = Cyrillic_ya Cyrillic_YA Cyrillic_ya Cyrillic_YA keycode 25 = Cyrillic_zhe Cyrillic_ZHE Cyrillic_zhe Cyrillic_ZHE keycode 26 = Cyrillic_ie Cyrillic_IE Cyrillic_ie Cyrillic_IE keycode 27 = Cyrillic_er Cyrillic_ER Cyrillic_er Cyrillic_ER keycode 28 = Cyrillic_te Cyrillic_TE Cyrillic_te Cyrillic_TE keycode 29 = Cyrillic_yeru Cyrillic_YERU Cyrillic_yeru Cyrillic_YERU keycode 30 = Cyrillic_u Cyrillic_U Cyrillic_u Cyrillic_U keycode 31 = Cyrillic_i Cyrillic_I Cyrillic_i Cyrillic_I keycode 32 = Cyrillic_o Cyrillic_O Cyrillic_o Cyrillic_O keycode 33 = Cyrillic_pe Cyrillic_PE Cyrillic_pe Cyrillic_PE keycode 34 = parenleft NoSymbol parenleft keycode 35 = parenright NoSymbol parenright keycode 36 = Return Multi_key Return keycode 37 = Control_L NoSymbol Control_L keycode 38 = Cyrillic_a Cyrillic_A Cyrillic_a Cyrillic_A keycode 39 = Cyrillic_es Cyrillic_ES Cyrillic_es Cyrillic_ES keycode 40 = Cyrillic_de Cyrillic_DE Cyrillic_de Cyrillic_DE keycode 41 = Cyrillic_ef Cyrillic_EF Cyrillic_ef Cyrillic_EF keycode 42 = Cyrillic_ghe Cyrillic_GHE Cyrillic_ghe Cyrillic_GHE keycode 43 = Cyrillic_che Cyrillic_CHE Cyrillic_che Cyrillic_CHE keycode 44 = Cyrillic_shorti Cyrillic_SHORTI Cyrillic_shorti Cyrillic_SHORTI keycode 45 = Cyrillic_ka Cyrillic_KA Cyrillic_ka Cyrillic_KA keycode 46 = Cyrillic_el Cyrillic_EL Cyrillic_el Cyrillic_EL keycode 47 = semicolon NoSymbol semicolon keycode 48 = apostrophe NoSymbol apostrophe keycode 49 = grave NoSymbol grave keycode 50 = Shift_L NoSymbol Shift_L keycode 52 = Cyrillic_ze Cyrillic_ZE Cyrillic_ze Cyrillic_ZE keycode 53 = Cyrillic_ha Cyrillic_HA Cyrillic_ha Cyrillic_HA keycode 54 = Cyrillic_tse Cyrillic_TSE Cyrillic_tse Cyrillic_TSE keycode 55 = Cyrillic_ve Cyrillic_VE Cyrillic_ve Cyrillic_VE keycode 56 = Cyrillic_be Cyrillic_BE Cyrillic_be Cyrillic_BE keycode 57 = Cyrillic_en Cyrillic_EN Cyrillic_en Cyrillic_EN keycode 58 = Cyrillic_em Cyrillic_EM Cyrillic_em Cyrillic_EM keycode 59 = comma less comma less keycode 60 = period greater period greater keycode 61 = slash NoSymbol slash keycode 62 = Shift_R NoSymbol Shift_R keycode 64 = Alt_L NoSymbol Alt_L keycode 65 = space NoSymbol space keycode 66 = Caps_Lock NoSymbol Caps_Lock keycode 67 = Cyrillic_yu Cyrillic_YU Cyrillic_yu Cyrillic_YU keycode 68 = Cyrillic_e Cyrillic_E Cyrillic_e Cyrillic_E keycode 69 = Cyrillic_softsign Cyrillic_SOFTSIGN Cyrillic_softsign Cyrillic_SOFTSIGN keycode 70 = Cyrillic_sha Cyrillic_SHA Cyrillic_sha Cyrillic_SHA keycode 71 = Cyrillic_shcha Cyrillic_SHCHA Cyrillic_shcha Cyrillic_SHCHA keycode 72 = Cyrillic_io Cyrillic_IO Cyrillic_io Cyrillic_IO keycode 73 = Cyrillic_hardsign Cyrillic_HARDSIGN Cyrillic_hardsign Cyrillic_HARDSIGN keycode 74 = F8 NoSymbol F8 keycode 75 = F9 NoSymbol F9 keycode 76 = F10 NoSymbol F10 keycode 82 = minus Prior minus Prior keycode 83 = Home quotedbl Home quotedbl keycode 86 = plus NoSymbol plus NoSymbol keycode 87 = Prior Multi_key Prior Multi_key keycode 88 = End XF86_Switch_VT_2 End XF86_Switch_VT_2 keycode 89 = Next XF86_Switch_VT_1 Next XF86_Switch_VT_1 keycode 95 = F11 NoSymbol F11 keycode 96 = F12 NoSymbol F12 keycode 118 = Delete Insert Delete keycode 132 = yen NoSymbol yen keycode 187 = parenleft NoSymbol parenleft keycode 188 = parenright NoSymbol parenright keycode 191 = acute NoSymbol acute keycode 192 = bar NoSymbol bar keycode 193 = underscore NoSymbol underscore keycode 194 = numbersign NoSymbol numbersign keycode 195 = exclam NoSymbol exclam keycode 196 = sterling NoSymbol sterling keycode 197 = quotedbl NoSymbol quotedbl keycode 198 = at NoSymbol at keycode 199 = colon NoSymbol colon keycode 200 = dollar NoSymbol dollar keycode 201 = EuroSign NoSymbol EuroSign keycode 222 = question NoSymbol question keycode 235 = Tab NoSymbol Tab
Once that's done, you can open the Keyboard Layout Changer, choose "RU-translit", and your keyboard layout will change to a layout similar to this one, with extra letters replacing F1-F7 (note: for those 7 letters, you can only use the Shift on the Pandora's front face, not the left shoulder button). To change back, open Keyboard Layout Changer again and select "default".
In the same way, you can create any other sorts of custom layouts. The easiest way to create a new modmap file is to copy+paste the contents of /home/username/.pndXmodmap into a new file in the /media/yourSDcard/pandora/appdata/kblayout/keymaps directory and make adjustments to whatever you want to change.