You are not logged in.

#1 2024-01-26 19:30:19

barney
Member
Registered: 2020-12-14
Posts: 130

[SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

I have laptop with multimedia keys. One of the multimedia keys is mapped to letter 'p'  and I want to change that. On the wiki page there is guide how to do this using the udev. The problem is that I don't know what model of the keyboard do I have. On the page:

AT keyboard DMI data matches:

evdev:atkbd:dmi:bvn*:bvr*:bd*:svn<vendor>:pn<product>:pvr*

where <vendor> and <product> are the firmware-provided strings exported by the kernel DMI modalias.

Input driver device name and DMI data match:

evdev:name:<input device name>:dmi:bvn*:bvr*:bd*:svn<vendor>:pn*

where <input_device_name> is the name device specified by the driver and <vendor> is the firmware-provided string exported by the kernel DMI modalias.

I think I have keyboard with input driver, but I don't know how to find <input device name> and <vendor> to write custom hwdb file.
Also there is a multimedia key that gives no scancode (showkey doesn't report one) and that key do nothing when I press it.

Last edited by barney (2024-01-27 02:46:46)

Offline

#2 2024-01-26 21:51:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,036

Re: [SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

Which multimedia key and what's the output of

xev -event keyboard

when pressing it?
Windows uses win+p to toggle displays, the key might actually just generate that in which case you're possibly not gonna be able to change this at all (but just binding win+p to whatever action you want to use it for will work)

Offline

#3 2024-01-26 22:05:18

barney
Member
Registered: 2020-12-14
Posts: 130

Re: [SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

seth wrote:

Which multimedia key and what's the output of

xev -event keyboard

when pressing it?
Windows uses win+p to toggle displays, the key might actually just generate that in which case you're possibly not gonna be able to change this at all (but just binding win+p to whatever action you want to use it for will work)

xev output:

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0x7a3, subw 0x0, time 1069962, (258,-384), root:(488,375),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0x7a3, subw 0x0, time 1069965, (258,-384), root:(488,375),
    state 0x40, keycode 33 (keysym 0x70, p), same_screen YES,
    XLookupString gives 1 bytes: (70) "p"
    XmbLookupString gives 1 bytes: (70) "p"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0x7a3, subw 0x0, time 1070096, (258,-384), root:(488,375),
    state 0x40, keycode 33 (keysym 0x70, p), same_screen YES,
    XLookupString gives 1 bytes: (70) "p"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0x7a3, subw 0x0, time 1070247, (258,-384), root:(488,375),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

You are right, it is win+p combination.
But I also want to know how to obtain <input device name> and <vendor>. Maybe in the future I will need that information.

Offline

#4 2024-01-26 22:27:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,036

Re: [SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

Offline

#5 2024-01-27 02:45:53

barney
Member
Registered: 2020-12-14
Posts: 130

Re: [SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

Thanks Seth, you are very helpful.
All keys on the keyboard are working, but some of them don't return scancodes when pressed. I have tested this with evtest in virtual console, X was not started. For example the key for turning wireless adapter on and off does not show scancode but it turns the wireless adapter on and off. How is this possible? Is it directly connected with the wireless adapter?

Offline

#6 2024-01-27 09:37:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,036

Re: [SOLVED]Problems reading the wiki "Maping scancodes to keycodes"

Is it directly connected with the wireless adapter?

It's very most likely a HW rfkill switch, yes.
You'll also not get a scancode from the Fn key.

Offline

Board footer

Powered by FluxBB