I want to be able to do brightness(8) work and volume adjustment from the console without using CLI tools.
In a strictly vt context, is there a way to get the scan codes so that I can bind them to the keyboard? I don't have/don't want X or Wayland.
There is
misc/kbdscan (Show scancodes of keys pressed and released), but it does not show function key scancodes.
This is from observation, not knowledge, certain function keys (hotkeys), not all, are enable by specific kernel modules, depending on machine brand and model.
Code:
% ls -1 /boot/kernel/acpi_*
/boot/kernel/acpi_asus.ko
/boot/kernel/acpi_asus_wmi.ko
/boot/kernel/acpi_dock.ko
/boot/kernel/acpi_fujitsu.ko
/boot/kernel/acpi_ged.ko
/boot/kernel/acpi_hp.ko
/boot/kernel/acpi_ibm.ko
/boot/kernel/acpi_panasonic.ko
/boot/kernel/acpi_sony.ko
/boot/kernel/acpi_toshiba.ko
/boot/kernel/acpi_video.ko
/boot/kernel/acpi_wmi.ko
On my ThinkPad E15 AMD
acpi_ibm(4) enables volume function keys, which work only in Xorg, not console, and only if the media player window has the focus. When the window focus or the virtual desktop changes, volume keys don't work anymore.
Brightness keys OTOH work in Xorg and console out of the box (no devd configuration needed as is the case in
fernandel post # 7), but only when a drm-kmod graphics driver (amdgpu in my case) is loaded, which creates
/dev/backlight/* device nodes:
Rich (BB code):
% ls -l /dev/backlight/*
lrwxr-xr-x 1 root wheel 23 Feb 25 09:40 /dev/backlight/amdgpu_bl00 -> ../backlight/backlight0
crw-rw---- 1 root video 0x199 Feb 25 09:40 /dev/backlight/backlight0
I went the kernel logging route and added some printf() into vt_core.
...
Given this, I should be able to test whether there's a windows key and F1/2/3
As for windows key on a ThinkPad E15 AMD:
Code:
# kbdscan
Scancode 28 released.
Scancode 105 pressed.
Scancode 105 released.
Timeout. Exiting...
105 here the "windows" key scancode, 28 "Enter".