DebianThis forum is for the discussion of Debian Linux.
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.
The problem is that the left alt key sends Alt_L to the X server while the right one sends Meta_R.
You should be able to solve the problem with
xmodmap -e "keysym Alt_L = Meta_L"
you can also add
keysym Alt_L = Meta_L
to ~/.xmodmap to make it persistent.
I may be completely backwards, I cannot check it at the moment. It may need to be
xmodmap -e "keysym Alt_L = Alt_L"
> The problem is that the left alt key sends Alt_L to the X
> server while the right one sends Meta_R.
Well, that may be the problem when using the console (what's
the "console" version of xev?), but from IceWM, both Alt keys
seem to work fine in everything except nano.
I posted this to the IceWM ML, but in case it's useful to
someone else here, the details on my system are:
Code:
$ xmodmap -pm
xmodmap: up to 3 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40), Alt_L (0x7d), Meta_L (0x9c)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x7f), Hyper_L (0x80)
mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c)
xev tells me about my left and right:
Code:
KeyPress event, serial 30, synthetic NO, window 0x1000001,
root 0x4c, subw 0x0, time 2364813, (424,-216), root:(430,615),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x1000001,
root 0x4c, subw 0x0, time 2364965, (424,-216), root:(430,615),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
KeyPress event, serial 30, synthetic NO, window 0x1000001,
root 0x4c, subw 0x0, time 2365924, (424,-216), root:(430,615),
state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x1000001,
root 0x4c, subw 0x0, time 2366068, (424,-216), root:(430,615),
state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
Ok, got a little confused. First I thought the problem was in X, then the console, now X again. I am back on track, so disregard my previous post. What terminal emulator are you using? Do you have the same problem in others? xterm, Eterm, aterm, konsole, gnome-terminal?
That may be dumb but why isn't it :
xmodmap -e "keysym Alt_L = Alt_R" ?
I think it's because X's rule is: "make whatever keycode that would usually result in a lhs_sym to instead generate a rhs_sym". So, dracae wanted me to tell X: "make whatever keycode that would usually generate an Alt_L instead generate a Meta_L" -- which would seem to make sense, since GNU nano is supposed to want a Meta when I hit my Alt key.
> Ok, got a little confused. First I thought the problem was in X,
> then the console, now X again.
I've got two separate problems:
1. In X, neither Alt key works with nano. They instead print funny little characters into my text file, and
2. In the console, only my left Alt key works in nano.
And now my third concern in understanding how all this works is, when I use "showkey", I seem to get a different keycode than I see with xev.
BTW, dracae, I've only ever used xterm. I just installed aterm, and [ ...drumroll...] nano works fine -- but this is with your xmodmap -e "keysym Alt_L = Meta_L" in effect.
I tried reversing that by running xmodmap -e "keysym Meta_L = Alt_L", and everything *still* works correctly in aterm. Weird. But nice. I wonder what the deal here is...(?)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.