You are not logged in.

#1 2019-03-31 15:26:34

Awoo
Member
Registered: 2019-03-31
Posts: 4

[Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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 248

How do I find the value it send?

Last edited by Awoo (2019-04-02 20:13:20)

Offline

#2 2019-03-31 16:19:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,470
Website

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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

#3 2019-03-31 20:35:34

Awoo
Member
Registered: 2019-03-31
Posts: 4

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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

#4 2019-03-31 20:40:00

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

Please edit your first post and use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2019-03-31 23:21:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,470
Website

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2019-04-01 04:16:58

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,457

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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.

Offline

#7 2019-04-01 20:13:33

Awoo
Member
Registered: 2019-03-31
Posts: 4

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

Trilby wrote:
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.

Docbroke wrote:

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

#8 2019-04-02 02:33:16

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,457

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

that confirms that some other process is interpreting your keypresses.

Offline

#9 2019-04-02 20:12:28

Awoo
Member
Registered: 2019-03-31
Posts: 4

Re: [Solved]Question on shotcut (backlight) for thinkpad X1C 2017

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

Board footer

Powered by FluxBB