Special keys on Dell XPS L502X

My Th rei4dan at gmail.com
Fri Mar 16 11:29:10 PDT 2012


Thanks for the tip!

I have tried to use evtest and here are results.

Key I:
------

I still get two key press events for this button and it is puzzling how
I could use it to get a single action.

Event: time 1331919071.656104, type 4 (EV_MSC), code 4 (MSC_SCAN), value
db
Event: time 1331919071.656109, type 1 (EV_KEY), code 125 (KEY_LEFTMETA),
value 1
Event: time 1331919071.656110, -------------- SYN_REPORT ------------
Event: time 1331919071.656913, type 4 (EV_MSC), code 4 (MSC_SCAN), value
2d
Event: time 1331919071.656917, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1331919071.656918, -------------- SYN_REPORT ------------
Event: time 1331919071.658889, type 4 (EV_MSC), code 4 (MSC_SCAN), value
2d
Event: time 1331919071.658892, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1331919071.658893, -------------- SYN_REPORT ------------
xEvent: time 1331919071.661927, type 4 (EV_MSC), code 4 (MSC_SCAN),
value db
Event: time 1331919071.661932, type 1 (EV_KEY), code 125 (KEY_LEFTMETA),
value 0
Event: time 1331919071.661932, -------------- SYN_REPORT ------------

If I press left meta key or 'x' on the keyboard, they produce identical
events:

Event: time 1331919098.264146, type 4 (EV_MSC), code 4 (MSC_SCAN), value
db
Event: time 1331919098.264151, type 1 (EV_KEY), code 125 (KEY_LEFTMETA),
value 1
Event: time 1331919098.264152, -------------- SYN_REPORT ------------
Event: time 1331919098.368375, type 4 (EV_MSC), code 4 (MSC_SCAN), value
db
Event: time 1331919098.368379, type 1 (EV_KEY), code 125 (KEY_LEFTMETA),
value 0
Event: time 1331919098.368380, -------------- SYN_REPORT ------------
Event: time 1331919136.502868, type 4 (EV_MSC), code 4 (MSC_SCAN), value
2d
Event: time 1331919136.502873, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1331919136.502874, -------------- SYN_REPORT ------------
xEvent: time 1331919136.569219, type 4 (EV_MSC), code 4 (MSC_SCAN),
value 2d
Event: time 1331919136.569223, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1331919136.569224, -------------- SYN_REPORT ------------

I noticed that key I, left meta an 'x' has these scancodes:
0xe0 0x5b 0x2d 0xad 0xe0 0xdb    Key I
0xe0 0x5b 0xe0 0xdb              left meta
0x2d 0xad                        'x'

Is there a way to tell apart key I from the combination of the other
two? Or the only way to make use of that button is to assign some
function to LEFTMETA+x?


Key II:
-------

Event: time 1331919857.440828, type 4 (EV_MSC), code 4 (MSC_SCAN), value
85
Event: time 1331919857.440832, type 1 (EV_KEY), code 224
(KEY_BRIGHTNESSDOWN), value 1
Event: time 1331919857.440833, -------------- SYN_REPORT ------------
Event: time 1331919857.440839, type 1 (EV_KEY), code 224
(KEY_BRIGHTNESSDOWN), value 0
Event: time 1331919857.440840, -------------- SYN_REPORT ------------
Event: time 1331919857.443935, type 4 (EV_MSC), code 4 (MSC_SCAN), value
85
Event: time 1331919857.443937, -------------- SYN_REPORT ------------

If I use Fn+F4 no event is reported, but display brightness is reduced.
Can I somehow assign different function for key II?


Key III:
--------

Event: time 1331920020.869582, type 4 (EV_MSC), code 4 (MSC_SCAN), value
84
Event: time 1331920020.869587, type 1 (EV_KEY), code 163 (KEY_NEXTSONG),
value 1
Event: time 1331920020.869588, -------------- SYN_REPORT ------------
Event: time 1331920020.872227, type 4 (EV_MSC), code 4 (MSC_SCAN), value
84
Event: time 1331920020.872231, type 1 (EV_KEY), code 163 (KEY_NEXTSONG),
value 0
Event: time 1331920020.872232, -------------- SYN_REPORT ------------

If I use keyboard for the same action (Fn+F10), I get the same keycode,
but different MSC value:

Event: time 1331920028.157210, type 4 (EV_MSC), code 4 (MSC_SCAN), value
99
Event: time 1331920028.157215, type 1 (EV_KEY), code 163 (KEY_NEXTSONG),
value 1
Event: time 1331920028.157216, -------------- SYN_REPORT ------------
Event: time 1331920028.162232, type 4 (EV_MSC), code 4 (MSC_SCAN), value
99
Event: time 1331920028.162236, type 1 (EV_KEY), code 163 (KEY_NEXTSONG),
value 0
Event: time 1331920028.162237, -------------- SYN_REPORT ------------

Can I somehow make X recognize that key III is different from Fn+F10 by
using this difference in MSC value?

Another question is - How do I assign the function I want to the key?
E.g. I want for the key III to turn off display backlight (equivalent to
"xset dpms force off"). In Gnome key bindings it looks that I can use
only normal keyboard functions together with control keys (e.g. <Alt>)
to set them to execute a predefined function. Is there a way to set it
to an arbitrary key - my key III?

In X11/xkb/keycodes/evdev I found this:
<I253> = 253;   // #define KEY_DISPLAY_OFF         245

Would it be the same as "xset dpms force off"? How could I assign key
III to <I253>?

Any help would be appreciated.


Reinis




More information about the xorg mailing list