You are not logged in.
Hello! I am new to linux, hope this is not a dumb question.
I have a thinkpad X1C 2017. Now I have install dual OS with window and arch. After installation, some fu keys work out of box, but some do not. I am trying to set brightness function key work.
1. There is file in /sys/class/backlight/, and I can use them to adjust backlight. Good.
2. Now I try to bind keys to commends which can adjust backlight. So I try to find out what are those keys. I use xev, but it give me something like
MappingNotify event, serial 34, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 34, synthetic NO, window 0x3200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 34, synthetic NO, window 0x3200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 34, synthetic NO, window 0x0,
keys: 4294967176 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 35, synthetic NO, window 0x3200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 35, synthetic NO, window 0x3200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 35, 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
MappingNotify event, serial 35, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248How do I find the value it send?
Last edited by Awoo (2019-04-02 20:13:20)
Offline
It looks like the keys are already grabbed by another process. What WM/DE are you using?
The relevant keysyms should be XF86MonBrightnessUp and XF86MonBrightnessDown, but if another process has already grabbed them, you will not be able to add additional bindings.
Last edited by Trilby (2019-03-31 16:20:57)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I am using i3, i dont think i3 is using it. I am guessing that there is something already handing some keys when i done installation of the OS, since other fn keys works out of box. But I dont know what is it. I am thinking it might be Thinkpad-acpi.
Offline
Please edit your first post and use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code
Offline
... I am thinking it might be Thinkpad-acpi.
thinkpad-acpi is a kernel module - that definitely is not running an X11 key grab.
But looking back at your output, there are a few focus in/out events. Was the mouse over the xev window when you pressed the brightness button(s)? If not, it would not show up in the xev output.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I agree with Trilby that xev output doesn't show anything suggesting that backlight keys were pressed/grabbed by xev. However xev alwasy gives very verbose output to make it confusing. I suggest to use xbindkeys, with command "xbindkeys -k" to find out keysms/keycodes.
Arch is home!
https://github.com/Docbroke
Offline
Awoo wrote:... I am thinking it might be Thinkpad-acpi.
thinkpad-acpi is a kernel module - that definitely is not running an X11 key grab.
But looking back at your output, there are a few focus in/out events. Was the mouse over the xev window when you pressed the brightness button(s)? If not, it would not show up in the xev output.
No the mouse is not over the xev window. I remove the mouse from the xev windows and focus to it using the shortcut. Then I press enter, and press the fn keys, then press the enter again. I copied the output between two enter event.
I agree with Trilby that xev output doesn't show anything suggesting that backlight keys were pressed/grabbed by xev. However xev alwasy gives very verbose output to make it confusing. I suggest to use xbindkeys, with command "xbindkeys -k" to find out keysms/keycodes.
I have tried that, it gives me no output.
Offline
that confirms that some other process is interpreting your keypresses.
Arch is home!
https://github.com/Docbroke
Offline
So I tried to reinstall Xorg and somehow now xev gives me reasonable output and I can bind keys. Don't really know why. But thank you everyone.
Offline