Need Help Remapping Right Alt Key in Mate 18.3/GPD Pocket
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need Help Remapping Right Alt Key in Mate 18.3/GPD Pocket
In /usr/share/X11/xkb/symbols/pc, I've successfully remapped several keys on the keyboard of my GPD Pocket. But I'm lost at how to remap the right alt key into a Delete key. For now, my workaround is to use the deprecated xmodmap in this startup script:
Which works, but I would like the remapping to be in /usr/share/X11/xkb/symbols/pc. Here is the pc file--can anyone advise where-and-what I would change to make the right alt key function as a repeating delete key?
The quickest way is to alter /usr/share/X11/xkb/keycodes/evdev instead. You'll see it has the entries
<RALT> = 108;
<DELE> = 119;
Swap the numbers and that's it.
Your symbols/pc file sets BKSP to BackSpace, so the problem must be in the evdev file. Look there and see what's mapped to <BKSP>. I have 22. You can find the keycodes by running xev, which gives results like
Code:
KeyPress event, serial 32, synthetic NO, window 0x3200001,
root 0x112, subw 0x0, time 893490, (297,-205), root:(536,328),
state 0x0, keycode 22 (keysym 0xff08, BackSpace), same_screen YES,
XLookupString gives 1 bytes: (08) "
XmbLookupString gives 1 bytes: (08) "
XFilterEvent returns: False
Check the keycodes and make sure that evdev assigns them to what you need.
I'm still at a loss but your help has perhaps helped me understand the problem.
Since I've already programmed the Delete key to be a BackSpace in the pc file, I no longer have an actual substitute key in evdev to finish the remapped equation <RALT> = ;
While my Delete key may be mapped in evdev as <DELE> = 119; the pc file has it as:
key <DELE> { [ BackSpace, BackSpace ] };
And the pc file appears to trump.
And I was incorrect when I said my delete-to-backspace was dead after putting in your evdev suggestions--it actually became a right alt key, leading me to believe that evdev needs to have keys switched rather than willing to lose the right alt altogether.
What I'm striving for is:
Right Alt = Delete
Delete = BackSpace
BackSpace = BackSpace
Which has no "key = Right Alt" in any equation, either in pc or evdev file.
It does seem that xmodmap is still necessary; I was only hoping to make the remapping cleaner, taking place only in /usr/share/X11/xkb
And my curiosity was piqued; you always feel that there's a solution in Linux.
While my Delete key may be mapped in evdev as <DELE> = 119; the pc file has it as:
key <DELE> { [ BackSpace, BackSpace ] };
And the pc file appears to trump.
What's happening is that the two files are used together to create a driver that is then compiled. In that, 119 is directly equated to BackSpace. The reason for the intermediate use of the names like BKSP is to enable Linux to use keyboards other than the normal PC (Sun, Apple, etc) where the scancodes are quite different. Currently the Alternate keys are being handles by the file symbols/altwin, not symbols/pc. You can alter them from the pc file, though, as that trumps altwin!
So,
1. Use xev to find the codes of BKSP, DELE, and RALT. Make sure that evdev has them correctly assigned.
2. Make sure that pc has DELE and BKSP both defined as BackSpace
3. Add a line to pc
key <RALT> {[Delete]};
I followed your latest instructions and while I have both backspace and delete acting as BackSpace, when I add:
key <RALT> {[Delete]};
to pc, it remains a right alt.
I'm not certain it's compiling b/c when I run:
sudo dpkg-reconfigure keyboard-configuration
I get this in console after all gui windows come up:
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
update-initramfs: deferring update (trigger activated)
I've never see that message when I was remapping other keys successfully.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.