Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 4100  / 1 Year ago, fri, may 5, 2023, 4:01:15

I have a laptop with Swedish keyboard layout, everything works well with the keyboard. Due to injuries I am using an external ergonomic USB keyboard, this is where I am experiencing difficulties.



The external keyboard doesn't have a key for Control_R or ALT-GR (I guess that's ALT_R) which causes trouble because typing @, $, and {} or [] all uses ALT-GR in Swedish keyboard layout.



UPDATE:: This is not true. The keyboard comes with both Control keys but was messed up due to custom remapping, read how to manage that here. After a complete reset I it turns out that the external keyboard has Alt-GR (shown as ISO_Level3_Shift by xev) as well (though backticks was hard to find). ::END UPDATE



The keyboard has a built-in remapping feature as well as macro features but there's no way to remap keys from the on-board keyboard to the external keyboard (as far as I know)



I would like to set one of my keys on the external keyboard to have a new keycode (such as Control_R or ALT_R and then remap that to acting as ALT-GR - is this possible? The reason I don't want the keycode Control_L is, if I remap it then the other Control key will be remapped as well.



With xev I have checked what keycode is trigged by clicking the key of ALT-GR on my on-board keyboard and that's keycode 108 (keysym 0xfe03, ISO_Level3_Shift). After some reasearch I've noticed this is not expected for the ALT-GR key, but this key works as I expect.



With xev I also check the output for the key on the external keyboard which I desire to use as ALT-GR: keycode 105 (keysym 0xffe3, Control_L).



I have another key on the external keyboard outputting the exact same thing, that key is the one I use for Control_L, making the one I wish was ALT_GR redundant.



I have messed around with xmodmap to see if I can get what I need but alas, with no success. Here are a few scenarios.



xmodmap -e "keycode 105 = Alt_R" #=> This disables both Control keys and doesn't work like ALT-GR, virtually the key doesn't do anything.



xmodmap -e "keycode 105 = ISO_Level3_Shift" #=> Same as above



Is there a way to address these problems?






Setup:




More From » keyboard

 Answers
1

If you have two keys with the same scancode, remapping those keys to another action will remap both keys with that scancode. There's no way (as far as I know) to differentiate two different keys if they have the same scancode.



As @falconer suggests, you can see if your two keys in fact are different or the same by checking with showkey -s in the virtual console. Remember how to switch back to X (ALT+F7) so you don't get stuck in the virtual console.



If you press your two keys that you wish to map differently, and those two keys gives you the same output here, then you need to look for another solution.



The external keyboard you are talking about does in fact have keys with the scancodes mapping to actions that you suggest are missing (Control_L and Control_R) - I would recommend you to reset the keyboard to it's default settings and check the output of your keys with xev again.



Make sure that you start with the correct Operative system settings, on your keyboard they are:



=+ + w for windows.



=+ + p for PC (non-windows).



=+ + m for Mac.



Setting that up before you start remapping will get you off to a good start with all the scancodes that you need.



As for the Alt-GR issue, ISO_Level3_Shift should be the correct action for this key (as far as I know). Keys with that action triggers the behavior of Alt-GR correctly.



Additionally, when tampering with scancodes and actions it may be nice to have some kind of software like KeyMon which will tell you what key or key combination you are pressing.


[#28023] Friday, May 5, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
learty

Total Points: 432
Total Questions: 115
Total Answers: 109

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
learty questions
Sat, May 21, 22, 15:30, 2 Years ago
Sun, Jan 9, 22, 22:31, 2 Years ago
Mon, Jul 4, 22, 11:31, 2 Years ago
Tue, Mar 22, 22, 16:28, 2 Years ago
;