alt key not working in nano
I'm using IceWM on Debian Etch and trying to get nano to work, but it's not listening to me when I hit the alt key.
For example, to move the cursor down-by-paragraph, alt-0 inserts a funny "degree" symbol (like a super-scripted zero). But ESC 0 works just fine. I've tried emacs, which uses the alt key extensively, and it works fine with emacs. The nano help screen refers to the "meta" key, rather than the alt key. How can I get the alt key to behave properly? |
Ok. Update: the left alt key works in the console. It's X (or IceWM) that's possibly intercepting that left alt key.
I've got a programmable keyboard, so I can remap the right alt key to give the same output as that left alt if need be. Any other icewimmers out there see this problem? |
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 Code:
KeyPress event, serial 30, synthetic NO, window 0x1000001, Code:
KeyCode Keysym (Keysym) ... |
See if there is a change with xmodmap -e "keysym Alt_L = Meta_L"
Edit: sorry misread the above. |
Quote:
|
Ran:
Code:
$ xmodmap -e "keysym Alt_L = Meta_L" Still the same problem with nano. Now, the output which differs with what's posted above: $ xmodmap -pm Code:
mod1 Meta_L (0x40), Meta_L (0x7d), Meta_L (0x9c) Code:
KeyPress event, serial 30, synthetic NO, window 0x1600001, Code:
64 0xffe7 (Meta_L) |
> You can give "showkey" a try...
Thanks kloss. From a console, showkey tells me Code:
left Alt: |
Try setmetamode esc or setmetamode meta. This is per tty, if it works you can add something like this to your rc.local, or equiv.(taken from manpage)
INITTY=/dev/tty[1-8] for tty in $INITTY; do setmetamode escprefix < $tty done |
Quote:
xmodmap -e "keysym Alt_L = Alt_R" ? |
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?
|
Quote:
I'm trying to figure out what the issue is here, and in doing so am putting up a short help doc on the subject: http://www.simisen.com/jmg/keycode_keysym_keymap.html Any input welcome, of course, especially since I've still got a couple of XXX's in that doc. Thanks, ---J |
> 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...(?) Thanks. ---J |
OK, in xterm ctrl+left click. You should have 2 options, Alt sends escape and Meta sends escape. Try those to see if you get the desired effect.
|
> OK, in xterm ctrl+left click. [snip]
dracae, I select the "Meta Sends Escape" item, and both Alt keys in nano now work! :) Thanks! |
All times are GMT -5. The time now is 10:05 AM. |