Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There is an option to specify a key to be used to acces 5th level on the keyboard in gnome-keyboard-properties ("Keyboard" under Hardware in System settings): Screenshot of said dialog

But if I set the 5th level to AltGr and the third level to right ctrl and if I set key 54 as follows: xmodmap -e "keycode 54 = 1 2 3 4 5 6 7 8" I get following results from pressing different variations:

keycode 54 = 1
keycode 54 + right ctrl = 5
keycode 54 + right ctrl + shift = 6
keycode 54 + shift = 2
keycode 54 + AltGr = 1
keycode 54 + AltGr + shift = 2

(1) So what does the 5th level modifier do?

(2) How do I set it up so that I can get 5 or six different characters out of a single key (modified by shift, altgr and right ctrl for example)?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Well, after a bit of digging:

(1) Key to choose 5th level does some weird stuff (reagrding some french layouts) that is not relevant to what I wanted to do. Basically it sets which key is going to act as ISO_Level5_Shift. ISO_Level5_Shift is used in some obscured layouts. This answer is based on the number of results google gives when searching for "ISO_Level5_Shift" and on these links.

(2) It cannot be used to get 6 symbols out of one physical key. One way to achieve this is with the use of file .xmodmap placed in $HOME directory.

First, command

xmodmap -pm

gives what keysymbols act as various modifiers. On my system it was like follows:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x9)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c)

mod3 needs to set up in order to use 6 symbols with one key. This needs to be placed into .xmodmap file:

clear mod3
clear mod5
keycode 94 = Mode_switch
add mod3 = Mode_switch
add mod5 = ISO_Level3_Shift

Then xmodmap -pm gave me:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x9)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        Mode_switch (0x5e),  Mode_switch (0xcb)
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  ISO_Level3_Shift (0x6c)

Where keycode 94 is the key I chose to act as mod3. Keycodes of various physical keys can be found with the command line tool xev (just run it and press various keys, keycodes will show up).

Then, if I place into .xmodmap file

keycode 54 = 1 2 3 4 5 6

or run

xmodmap -e "keycode 54 = 1 2 3 4 5 6"

I get six different symbols out of one key with using altgr, shift and keycode 94 (it is a useless key next to left shift on my physical layout).

UPDATE: if you need just five symbols, it is handy to set it up like this:

keycode 54 = 1 2 3 3 5 6

It occasionaly happens to me that I get 4 instead of 3 otherwise.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.