Open dithpri opened 2 years ago
Thank you for your interest in the project, I will look into the following keys and implement them tomorrow.
Hi are you talking about this key? I see quite a few under display and I don't know what function the key serves.
https://docs.rs/evdev/latest/src/evdev/scancodes.rs.html Found nothing under the name launch, maybe it's under some other name? if you can find it above I can bind it. If it's not in that list, I can't bind that key.
From what evtest tells me, the key for XF86Launch1 is KEY_PROG1
, and for XF86Display is KEY_SWITCHVIDEOMODE
though I can't use them by default on my Thinkpad with swhkd because of this check:
https://github.com/waycrate/swhkd/blob/04e51255a4ef73151eac752c8c10dd51f1f30639/src/daemon.rs#L345
Both keys are in a separate device to the keyboard which does not contain an enter key:
If that check is modified so that this device is recognized as a keyboard by swhkd, KEY_PROG1
and KEY_SWITCHVIDEOMODE
work.
(The modification I did for testing was just returning true except for swhkd virtual output devices, but that disabled my mouse :P )
(The modification I did for testing was just returning true except for swhkd virtual output devices, but that disabled my mouse :P )
That is because we use that function to get valid keyboard and then call kernel grab syscall, so when you hardcoded true, it grabbed your mouse too.
If that check is modified so that this device is recognized as a keyboard by swhkd, KEY_PROG1 and KEY_SWITCHVIDEOMODE work.
Understood. Do you have any ideas for better keyboard checking? Checking for key_enter is definitely not ideal.
Maybe detecting if something is not a keyboard? (Detecting if it's a mouse or joystick, etc.)
The only other type of detection I can think of is checking if it supports any possibly grabbable keys.
Maybe detecting if something is not a keyboard? (Detecting if it's a mouse or joystick, etc.)
Doesn't sound robust due to a couple reasons:
The only other type of detection I can think of is checking if it supports any possibly grabbable keys.
Afaik, key's aren't grab-able, output/input devices are.
Version Information:
Linux laptop 5.17.8-arch1-1 #1 SMP PREEMPT Mon, 16 May 2022 20:45:27 +0000 x86_64 GNU/Linux
swhkd 1.2.0
Describe the bug: XF86Display, XF86Launch1 keys are not unsupported
Expected behavior: XF86Display, XF86Launch1 keys are supported
Actual behavior:
Lines 91-95:
To Reproduce: Use
XF86Display
orXF86Launch1
key in config.Additional information: From imported sxhkd config.