You are not logged in.
Hi,
I'm configuring some shortcuts for the Sway WM running on my ThinkPad x230. I've set volume up/down/mute and designated a show webcam key using XF86 key bindings.
I've found the correct keys looking up online, I'm wondering if there is some convenient way to find which key I'm pressing in the XF86 key library (?). For instance I want to designate Fn+F3 to screen lock using a swaylock command.
I've seen people using xev for this but couldn' t manage to run it as I wish to.
Thankss.
Edit: I've installed wev which is the wayland suitable keyboard listener, I suppose.
I've accesed the desired XF86 key names while doing:
$ wev | grep sym
And when pressed, Fn+F3, it gave XF86ScreenSaver.
But sway config somehow did not do anything when this is added into the sway config:
bindsym XF86ScreenSaver exec swaylock -c 000000 -l
Weird.
Last edited by pixis (2024-09-16 22:44:48)
Offline
what you are looking for is called key scan code: https://en.wikipedia.org/wiki/Scancode
Offline
wev
It operates at a higher level than scancode. From sway, run wev. Put your cursor in the wev window (ignore all the mouse events). Punch the key you want. Take note of the press and release codes in the wev output.
ewaller@odin/~% pacman -Qi wev
Name : wev
Version : 1.0.0-13
Description : A tool for debugging wayland events on a Wayland window, analagous to the X11 tool xev
Architecture : x86_64
URL : https://git.sr.ht/~sircmpwn/wev
Licenses : custom
Groups : None
Provides : None
Depends On : wayland libxkbcommon
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 35.96 KiB
Packager : Brett Cornwall <ainola@archlinux.org>
Build Date : Wed 01 Nov 2023 11:58:43 AM PDT
Install Date : Sat 04 Nov 2023 03:11:51 PM PDT
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
ewaller@odin/~% Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline