You are not logged in.

#1 2008-01-31 06:29:45

drewbug01
Member
From: chicago
Registered: 2007-04-06
Posts: 85
Website

xev/xmodmap only working part of the time [resolved]

Ok guys, maybe its just my mind playing tricks on me at 1am, but...

I bought a new laptop. Been trying to get it setup (I even made a wiki page for it in hardware->laptops), and tonight I tackled accelerated 3D, suspend to ram, and function keys (multimedia keys). Which brings me to this post...

The nice, easy way of setting it up through XFCE4 or keytouch wasn't recognizing all of my keys, so I turned to xmodmap.

First off, the kernel isn't recognizing all of them. No biggie, I figure we'll play around with evdev and scripting later.
So ... the ones that do work... well they're producing keycodes in xev! Great!

Made my xmodmap file
Ran /usr/bin/xmodmap $HOME/.Xmodmap
Voila! xev is now showing me keysyms! On to setting them up through XFCE, right?
Wrong.

I decided to clean up a bit, and restarted X just for the heck of it.

Now, my xev is not producing keysyms. Not even showing me keyCODES anymore.

Where before it was printing your normal output, similar to

KeyRelease event, serial 31, synthetic NO, window 0x2a00001,
    root 0x87, subw 0x0, time 2557948, (314,172), root:(945,537),
    state 0x50, keycode 174 (keysym 0x0, same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

(before xmodmap it was null, after it showed the keysym as well) (i just hit a letter and copied/modified this, its not EXACTLY right, since now everything is screwed up)

now it is showing me

KeymapNotify event, serial 31, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

FocusOut event, serial 31, synthetic NO, window 0x2a00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 31, synthetic NO, window 0x2a00001,
    mode NotifyUngrab, detail NotifyAncestor

for the same keys.

This happened the other day, and I just rebooted a few times and it went away. Came right back tonight though.
I'm not really sure what to do with this one.
Ideas?

Last edited by drewbug01 (2008-02-02 08:28:58)

Offline

#2 2008-01-31 06:37:40

drewbug01
Member
From: chicago
Registered: 2007-04-06
Posts: 85
Website

Re: xev/xmodmap only working part of the time [resolved]

ok, update --
Played around in xev again, and actually some of them ARE working fine.
Specifically the ones that are now NOT working are the three keys that I had mapped to an XF86Audio*** keysyms, which would be
Function+Esc, keycode 160, keysym XF86AudioMute
volWheel up, keycode 176, keysym XF86AudioRaise
volWheel down, keycode 174, keysym XF86AudioLower

still, any thoughts?

Offline

#3 2008-01-31 06:54:33

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: xev/xmodmap only working part of the time [resolved]

Hello there,

It may be that these keys are generating scan codes that X does not translate into key codes. If X doesn't get the key codes, it cannot do any type of key mapping with xmodmap. I had a similar problem with my Dell Inspiron 9300. Certain keys did not get translated by X. To solve this problem I did the following:

1. Figure out the scan codes for the keys that do not generate X key codes. There is a console program around that lets you do this, but I can't remember it for the life of me. Surely if you google you will find it. I think I recall finding it in an article about setting up these extra keys on Dell laptops, but I'm not sure.

2. Use setkeycodes to map these scan codes to key codes that X can use. In my case, I added the following to my rc.local file to always map the scan codes on boot:

# Map the Fn+F1 (Hibernate) key
setkeycodes e00a 123

# Map the Fn+F3 (battery) key
setkeycodes e007 120

3. Use xmodmap to map these key codes to a key symbol you can use.

4. Use xbindkeys (or whatever the XFCE equivalent is) to map these keys to your desired action.

I hope this gets you pointed in the right direction. Good luck.
jay

Offline

#4 2008-02-02 08:28:35

drewbug01
Member
From: chicago
Registered: 2007-04-06
Posts: 85
Website

Re: xev/xmodmap only working part of the time [resolved]

welp, never mind.
xev was just behaving in ways that i didnt not expect.
turns out all the function keys ARE still working after the xmodmap and reboot, but just not generating the expected output in xev.
confusing to me, but thats ok. i'll be enlightened someday!

--drew

Offline

Board footer

Powered by FluxBB