how to bind AltGr to Control_L in linux virtual console?

0

I want that my right alt AltGr behaves as my left control Control_L in linux virtual console.

I use the showkey utility and found out that pressing AltGr generates keycode 100. So I wrote a rebind.map file with this line:

keycode 100 = Control

And then I've loaded this configuration with loadkeys $(readlink -f rebind.map)

So If I press AltGr + c it should produce the same result as Control+c. And it does, on the first press. On the second press, the keyboard becomes unusable.

How do I correctly bind my AltGr to behave as Control_L in linux virtual console?

ninrod

Posted 2017-09-02T03:21:13.273

Reputation: 229

Which Linux distribution are you on? – fpmurphy – 2017-09-02T04:30:09.083

@fpmurphy1 I'm on arch linux. – ninrod – 2017-09-02T04:31:31.623

Answers

0

Ok, I've found the solution. I don't know exactly why it works though. The secret is to add keymaps 0-15 above the keycode 100 = Control line, like so:

keymaps 0-15
keycode 100 = Control

ninrod

Posted 2017-09-02T03:21:13.273

Reputation: 229

1

Do you mean unusable as in Control seems to be pressed constantly? I just tried the same thing and had the same problem. My workaround was saving the current keymap with dumpkeys and extracting the line for the keycode I wanted to change, which was

keycode 56 = Alt ... (Alt repeated a total of 128 times)

So I changed that line to be

keycode 56 = Control ... (Control repeated a total of 128 times)

and loaded the file with that line in it via loadkeys and it seems to work now.

fcdemirci

Posted 2017-09-02T03:21:13.273

Reputation: 11