You are not logged in.

#1 2010-07-31 01:33:27

jni
Member
Registered: 2009-10-30
Posts: 36

[SOLVED] Weird keyboard mapping issue (not hardware)

Hi all,

I'm not a fan of posting in forums, as i usually always find my solution on other topics or fix it myself after hard work. But this time i must admit, this goes beyond my competence (although i'm pretty sure it's a stupid thing i havent thought of lol)

Alright, here it is. After a power failure, i had to reboot... but i had made some nvidia ( -> 195.36) and kernel ( -> 2.6.34) upgrades meanwhile, and i couldn't boot anymore. I fixed that by downgrading, then X didn't want to start so i did the same on nvidia.

Since then, my keyboard layout is messed up. My right alt key behaves as the left arrow (although the left arrow still fonctions well). The down arrow generates down keypress as usual, but followed by a "enter". For example, here is the result of xev after pressing the alt key:

KeyRelease event, serial 46, synthetic NO, window 0x2000001,
    root 0x142, subw 0x0, time 133186949, (-682,-202), root:(398,157),
    state 0x0, keycode 113 (keysym 0xff51, Left), same_screen YES,
    XLookupString gives 0 bytes:

I tried "kdb" and "Keyboard" in xorg.conf, both giving the same result. This is "not too bad", except that i'm a programmer, so i need my brackets lol I can do alt+bracket key... it works, but it generates a left arrow first, so it's kind of a waste of time.

The keyboard is not at fault, it works perfectly on my laptop (both on windows and ubuntu that are on my laptop... yuck lol). I even got a new keyboard yesterday (thanks to my boss stepping on the other one), and it has the exact same behavior... so i doubt it's hardware issue.

Well, that's my situation... and i gave up lol don't know what else to test, so i hoped some1 else would come up with some genius idea.

Thanks in advance!
Jni

PS: sorry for my english hehe

Last edited by jni (2010-07-31 16:57:21)

Offline

#2 2010-07-31 10:13:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Offline

#3 2010-07-31 15:07:43

jni
Member
Registered: 2009-10-30
Posts: 36

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

I installed it and it seems to work, but doesn't really help.

In fact, with the "find key" button there i pressed "right alt" then "left" and got :

keycode: 108  (from the right alt)
keycode: 113  (also from the right alt)
keycode: 113  (from the left arrow)
keycode: 100  (again from the left arrow)

So i tried to change 113 (which is set to "Left") to "Alt_R"... it worked but then my left arrow behave as Alt. For information, here is what i had by default when i opened xmodconfig

100 = Henkan_Mode
108 = ISO_Level3_Shift
113 = Left

My keyboard is set to french canadian layout (i.e. setxkbmap ca). Also, i found out it worked fine in the TTY, so i'd guess it's X that's messed up.

Thanks for the suggestion, but it seems that if both keys generate the same keycode, i'll have to choose between arrow and alt lol

Offline

#4 2010-07-31 15:22:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Were you using xorg 1.8 before with the keyboard working OK? Maybe it's a problem w/ the kbd layout.
In xorg-server 1.8 it's better to keep it in /etc/X11/xorg.conf.d/keyboard.conf.
http://wiki.archlinux.org/index.php/Xor … 20G_Laptop

Do you have evdev installed and have /etc/X11/xorg.conf.d/10-evdev.conf file?

Offline

#5 2010-07-31 15:46:00

jni
Member
Registered: 2009-10-30
Posts: 36

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

I used to have Xorg-1.8 but i had to downgrade along with nvidia, due to nvidia 190 requiring xorg < 1.8 :

X.Org X Server 1.7.6
Release Date: 2010-03-17
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.33-ARCH x86_64
Current Operating System: Linux jni-desktop 2.6.32-ARCH #1 SMP PREEMPT Tue Feb 23 19:43:46 CET 2010 x86_64
Kernel command line: root=/dev/disk/by-uuid/96581f3f-9a53-476e-b0e7-9ca2b047f361 ro rootdelay=50 rootfstype=reiserfs
Build Date: 01 April 2010  05:28:33PM

Current version of pixman: 0.18.2
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.

So i never really had time to see if keyboard with 1.8 was working, nvidia wudnt start and i found on forum that i had to downgrade it for now, error with the new .34 kernel.

xf86-input-evdev is installed, but i cannot find it's config file. I don't have a xorg.conf.d directory, all i have is a xorg.conf. Here is my xorg.conf, if that can be of any use...

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder58)  Wed Dec  9 16:34:26 PST 2009

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildmeister@builder58)  Wed Dec  9 16:35:48 PST 2009

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
    Option         "AllowEmptyInput" "false"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "evdev"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "0"
    Option         "AllowEmptyInput" "off"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG W2053"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9500 GT"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinViewXineramaInfoOrder" "CRT-0"
    Option         "TwinView" "0"
    Option         "metamodes" "1600x900 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

(very sorry for the lack of bbcode on this... but remember, my alt key is broken lol)

Offline

#6 2010-07-31 15:53:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Have you tried setting the correct kbd layout?
XkbLayout "ca" or sth like that

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option "XkbLayout" "ca"
EndSection

BTW, setxkbmap has nothing to do w/ tty.

Edit: If you're using xorg-server 1.7 you need hal running.

Last edited by karol (2010-07-31 16:01:10)

Offline

#7 2010-07-31 16:10:05

jni
Member
Registered: 2009-10-30
Posts: 36

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Adding the option changed nothing, unfortunatly. I know setxkbmap has nothing to do with TTY, i was just pointing that keyboard works fine in TTY, in case that can help..

It seems that hal is running :

hal       3302  0.0  0.0  38728  3676 ?        Ssl  Jul29   0:00 /usr/sbin/hald
root      3303  0.0  0.0  22116  1344 ?        S    Jul29   0:00 hald-runner
root      3332  0.0  0.0  24372  1608 ?        S    Jul29   0:08 hald-addon-input: Listening on /dev/input/event1 /dev/input/event2 /dev/input/event3 /dev/input/event4
root      3348  0.0  0.0  24224  1248 ?        S    Jul29   0:45 hald-addon-storage: polling /dev/sr0 (every 2 sec)
hal       3363  0.0  0.0  19728  1104 ?        S    Jul29   0:00 hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event

but i cannot start/stop/restart it with /etc/rc.d/hal... i guess that might be the issue then. I tried reinstalling it aswell, didnt change a thing

Thanks again for your help!!

Offline

#8 2010-07-31 16:28:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

> Adding the option changed nothing, unfortunatly.
But generally, apart from the weird key issue, is the layout correct?

http://wiki.archlinux.org/index.php/Xmodmap
Maybe you can edit your map and tell the stupid key to behave in a way that maps. keycode: 113 to one key only.

Offline

#9 2010-07-31 16:37:01

jni
Member
Registered: 2009-10-30
Posts: 36

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Yes, the rest of the layout is alright, aside from the alt key and the down arrow as i said earlier.

I don't know if i can edit the keycode or remap it, both left arrow and alt_R generate the same keycode... actually, all arrows and the alt_r generate 2 keycodes each time, is this normal behavior?

looking at ur tutorial, the only idea i can think of is mapping another key to behave as my alt key...

Edit: for the left arrow for example, i get keycode 113 (Left) and then 100 (Henkan_Mode)... what is Henkan_Mode? Seems like a japaness thing according to google, idk why i get that tho lol but well, the first keycode works too, so my left key actually goes one character left as normal, the Henkan_Mode doesn't seem to change anything. Problem is that the alt key behaves the same as the left arrow lol

Last edited by jni (2010-07-31 16:40:52)

Offline

#10 2010-07-31 16:50:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Maybe you can remove keycode 113  from the left arrow
http://wiki.archlinux.org/index.php/Xmodmap#Example

Offline

#11 2010-07-31 16:57:03

jni
Member
Registered: 2009-10-30
Posts: 36

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

Actually, that's not what i did since both keycodes are the same. But i used the fact that 113 was redundant in both... So what i did is completly unmap keycode 113, put it to NoSymbol everywhere. The i used the other keycode (since it generates two) to mimic the "normal" behavior.

Kind of an ugly workaround, but it works! i didnt know xmodmap... that's def something i'll remember! Hehe, thanks again for your help and patience, much appreciated!

Offline

#12 2010-07-31 17:00:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Weird keyboard mapping issue (not hardware)

jni wrote:

Actually, that's not what i did since both keycodes are the same. But i used the fact that 113 was redundant in both... So what i did is completly unmap keycode 113, put it to NoSymbol everywhere. The i used the other keycode (since it generates two) to mimic the "normal" behavior.

Kind of an ugly workaround, but it works! i didnt know xmodmap... that's def something i'll remember! Hehe, thanks again for your help and patience, much appreciated!

So in the end you did remove keycode 113 from the left arrow :-)
Just make a note about all those hacks in case you broke some other thing.

Offline

Board footer

Powered by FluxBB