Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alt key not working as required
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sat May 07, 2005 2:25 pm    Post subject: Alt key not working as required Reply with quote

Hello,

I use the functionalities of Alt-. and Alt-d in bash a lot to get previous argument and emacs-style "kill-word" respectively. Now, after starting Xorg, I get strange characters instead, BUT the same thing works if I use my ESC-key. (Before doing "startx" I have the functionality I want, so I figure there's something wrong with my xorg). Here's the relevant part:

Code:
Section "InputDevice"
   Identifier  "Keyboard0"
   Driver      "kbd"

        Option     "XkbModel"      "pc104"
        Option     "XkbLayout"     "se"
 

EndSection


I have an IBM R51 Thinkpad. Anyone can tell me what's wrong?
Back to top
View user's profile Send private message
zeruel
n00b
n00b


Joined: 05 Mar 2003
Posts: 28
Location: Scotland

PostPosted: Sat May 07, 2005 3:00 pm    Post subject: Reply with quote

I had a similar problem, when using xterm with xorg,
alt+1, alt+2, etc gave me ¹ ² etc. instead of switching 'windows' in irssi like it used to with xfree
I fixed it by adding the following to my .Xdefualts

Code:

XTerm*eightBitInput:  false
XTerm*metaSendsEscape: true


either that or start xterm like

Code:

xterm -xrm "XTerm*eightBitInput: false" -xrm "XTerm*metaSendsEscape: true"

_________________
Zeruel
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sat May 07, 2005 3:09 pm    Post subject: Reply with quote

Thanks Zeruel,

but the problem persists in all my apps since I think it is something wrong with my xorg.conf. So, for example, in emacs if I want to do "kill-word" with Alt-D, it does not work. I'd like the Alt-key to behave as the Meta-key in X. I've tried also
Code:
Option "LeftAlt"    "Meta"
but it did not work either.
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sun May 08, 2005 6:35 pm    Post subject: Reply with quote

I tried catching the key event with "xev" and found the following when pressing (and releasing) my left Alt key + "d".

Code:
KeyPress event, serial 30, synthetic NO, window 0x800001,
    root 0x3a, subw 0x0, time 38662193, (76,154), root:(565,174),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 30, synthetic NO, window 0x800001,
    root 0x3a, subw 0x0, time 39470996, (119,115), root:(600,135),
    state 0x8, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x800001,
    root 0x3a, subw 0x0, time 39471276, (119,115), root:(600,135),
    state 0x8, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"

 KeyRelease event, serial 30, synthetic NO, window 0x800001,
    root 0x3a, subw 0x0, time 38663455, (76,154), root:(565,174),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:


I have a cygwin installation on another computer and on this one I get the desired results. Looking at the xev dump on that one I can observe the same information as above (discounting obvious discrepancies), but with "serial" exchanged to 22 (first press of "Alt) and then 25.

To me, it seems like xterm and bash gets the same events on both setups and maybe I can find the fault by looking at those applications, but the behaviour in emacs has changed at the same time also (putting out an "ä" when pressing Alt-d), making it unlikely that both those applications have changed their behaviour at the same time.

Any ideas where I can look further?

(A simple question. If you have an xterm with bash right now up and running. What happens if you type "abcd", go back to the beginning and then holding down "Alt" and press "d"? Does your "abcd" disappear? If so, can you tell me what you get from doing the same thing in xev?
Back to top
View user's profile Send private message
Kazaza
Tux's lil' helper
Tux's lil' helper


Joined: 28 Mar 2004
Posts: 100
Location: Sweden

PostPosted: Tue May 10, 2005 9:01 am    Post subject: Reply with quote

Hi... I read on the swedish forum about your problem, but I will follow it up here, incase there are other searching for an answer...
I did the test as you described it above, and got the result that "abcd" dissappeared... and xev gives me these outputs:
Code:
KeyPress event, serial 30, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 932309, (823,351), root:(826,377),
    state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 30, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 932940, (823,351), root:(826,377),
    state 0x18, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 933094, (823,351), root:(826,377),
    state 0x18, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"

KeyRelease event, serial 30, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 933379, (823,351), root:(826,377),
    state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:

The part in /etc/X11/xorg.conf looks like this:
Code:
Section "InputDevice"

    Identifier  "Keyboard1"
    Driver      "kbd"
    Option "AutoRepeat" "500 30"
    Option "RightAlt"    "ModeShift"
    Option "XkbModel"   "microsoft"
    Option "XkbLayout"  "se"

EndSection

As you can see I have a slightly different setup for my keyboard, I'm using a microsoft natural multimedia keyboard, and I do not know how much the difference is just because of that... If you would like me to post anything else from any config, just let me know... ill bookmark this thread...
You might wanna try the option:
Code:
 Option     "XkbModel"      "pc105"



PS. vet inte om det är till nån hjälp, men det kan vara värt ett prov... D.S
Back to top
View user's profile Send private message
durian
Guru
Guru


Joined: 16 Jul 2003
Posts: 312
Location: Margretetorp

PostPosted: Tue May 10, 2005 2:02 pm    Post subject: Re: Alt key not working as required Reply with quote

cajzell wrote:
Hello,

I use the functionalities of Alt-. and Alt-d in bash a lot to get previous argument and emacs-style "kill-word" respectively. Now, after starting Xorg, I get strange characters instead, BUT the same thing works if I use my ESC-key. (Before doing "startx" I have the functionality I want, so I figure there's something wrong with my xorg). Here's the relevant part:

Code:
Section "InputDevice"
   Identifier  "Keyboard0"
   Driver      "kbd"

        Option     "XkbModel"      "pc104"
        Option     "XkbLayout"     "se"
 

EndSection


I have an IBM R51 Thinkpad. Anyone can tell me what's wrong?


Mine looks like:

Code:
    Option "XkbRules"   "xorg"
    Option "XkbModel"   "pc105"
    Option "XkbLayout"  "se"


Works with ctrl-A and D. Swedish keyboard.

-peter
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Tue May 10, 2005 7:07 pm    Post subject: Reply with quote

Guys,

I am so sorry for troubling you all with this. I should have listened to Zeruel from the beginning, but I was so convinced I had the same problem in emacs, so I really didn't think about it. :oops: :oops: :oops:

The thing was that my emacs was functioning properly and I really was convinced it did not.

So, better late than never (as we sort of say in Sweden), Thanks again Zeruel!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum