-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
In both udev and steam-runtime-tools, the equivalent of SDL_UDEV_DEVICE_KEYBOARD
is split into two:
KEYBOARD
is a reasonably full alphanumeric keyboard that you could use to type commands or your password;HAS_KEYS
is anything that can produce keyboard events, including USB numeric keypads, Bluetooth headset volume buttons, ACPI power buttons and even a few game controllers
At the moment SDL_UDEV_DEVICE_KEYBOARD
is basically udev's HAS_KEYS
.
If we want to change this in SDL 3, I would suggest renaming SDL_UDEV_DEVICE_KEYBOARD
to SDL_UDEV_DEVICE_HAS_KEYS
and introducing a new SDL_UDEV_DEVICE_FULL_KEYBOARD
, so that anyone porting SDL 2 code is forced to decide which one they meant.
The logic in steam-runtime-tools, and I think also udev, is that a keyboard is assumed to be a full alphanumeric keyboard if it has at least Escape, 0-9 and Q-D, so the end of SDL_EVDEV_GuessDeviceClass
would change to something like this:
keyboard_mask = 0xFFFFFFFE;
if ((bitmask_key[0] & keyboard_mask) != 0) {
devclass |= SDL_UDEV_DEVICE_HAS_KEYS;
}
if ((bitmask_key[0] & keyboard_mask) == keyboard_mask) {
devclass |= SDL_UDEV_DEVICE_FULL_KEYBOARD;
}
Metadata
Metadata
Assignees
Labels
No labels