this post was submitted on 23 Aug 2023
11 points (100.0% liked)

Linux

48178 readers
1098 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

basically each of the following: fn+f2 or fn+f3 (not even being recognised by evtest ) and the lid being closed or opened is being reported as "Event: time 1692812642.988180, type 1 (EV_KEY), code 238 (KEY_WLAN), value 1".

so I though about remapping "Event: time 1692812642.988180, type 4 (EV_MSC), code 4 (MSC_SCAN), value d7" as the closing lid thingy

the same for fn+f2 and fn+f3 (increase and decrease brightness) I have to remap this "Event: time 1692812647.457821, type 4 (EV_MSC), code 4 (MSC_SCAN), value ab" so my question is I can remap the keyboard here 60-keyboard.hwdb but where can I remap the ev_msc stuff

basically all this to say I want to tell udev that the msc this with id d7 is actually the toggle for closing the lid and the msc thing with id ab are actually the two buttons that increase and decrease brightness and yeah that's all

you are viewing a single comment's thread
view the rest of the comments
[–] pastaq@lemmy.ml 3 points 1 year ago (1 children)

If you run sudo dmesg -w it should tell you the scancodes that each of those events is triggering. You can then create a /etc/udev/hwdb.d/50-my-device.hwdb file to map those scan codes to keycodes.

Here's an example of a .hwdb file I made for Ayaneo handhelds:

## AYANEO DEVICES
evdev:name:AT Translated Set 2 keyboard:dmi:*:svnAYANEO:*
  KEYBOARD_KEY_66=f15
  KEYBOARD_KEY_67=f16
  KEYBOARD_KEY_68=f17

You can find the appropriate evdev:* information by running sudo udevadm test /dev/input/eventX where eventX is the evdev fd for the device in question. evtest will show you the names.

[–] beh_93825561489@lemmy.ml 1 points 1 year ago* (last edited 1 year ago) (1 children)

so this is the output for the fn+f2/3 "[32752.594169] atkbd serio0: Use 'setkeycodes e02b ' to make it known. [32752.599005] atkbd serio0: Unknown key released (translated set 2, code 0xab on isa0060/serio0)."

and the output for the closing lid "[32780.534749] atkbd serio0: Use 'setkeycodes e058 ' to make it known. [32780.538013] atkbd serio0: Unknown key released (translated set 2, code 0xd8 on isa0060/serio0)."

my question is isn't closing the lid is already assigned to "button/wlan WLAN 00000080 00000000 K" (output from acpi_listen)

  • so what should I do now
  • this part is actually unclear

"You can find the appropriate evdev:* information by running sudo udevadm test /dev/input/eventX where eventX is the evdev fd for the device in question. evtest will show you the names."

basically how to actually do something like this MSC_KEY_d7=lid MSC_KEY_ab=brightness_thingies

  • yeah thanks
[–] pastaq@lemmy.ml 2 points 1 year ago (1 children)

You will notice that every keypress in evtest is also preceded by a KEY_MSC. This is just the evdev responding to a scancode. If the hwdb has this scancode pre-assigned in 60-keyboard.hwdb then it creates the EV_KEY event that is mapped. What you want to do is turn this EV_MSC into an EV_KEY by mapping the unknown scancode to a evdev event code using the hwdb file.

The arch wiki has a good article on how to map these scancodes and identify what keycode you want to map. It is generic enough that it should work for most distros. Read all of section 2, it goes into specific detail about your question.

https://wiki.archlinux.org/title/Map_scancodes_to_keycodes#Using_udev

[–] beh_93825561489@lemmy.ml 1 points 1 year ago

thanks a lot that will certainly help