Skip to content

libobs: Map non-numlock keypad keys on Wayland - #14080

Open
dualfroz wants to merge 1 commit into
obsproject:masterfrom
dualfroz:fix-wayland-keypad-no-numlock
Open

dualfroz wants to merge 1 commit into
obsproject:masterfrom
dualfroz:fix-wayland-keypad-no-numlock

Conversation

@dualfroz

Copy link
Copy Markdown

Description

maps the keypad keysyms xkb reports with NumLock off (KP_Home, KP_End, KP_Up, ...) to the regular keys on Wayland, so they can be bound as hotkeys. KP_Begin (numpad 5) goes to OBS_KEY_CLEAR with a "Clear" label.

Motivation and Context

they all returned OBS_KEY_NONE. as kkartaltepe suggested in the thread, they map to the normal keys instead of new ones, which is also what Windows gives (VK_END, VK_CLEAR...).

Fixes #9244

How Has This Been Tested?

small program compiling the mapping functions before/after against a real xkb keymap (evdev/pc105/us) with NumLock toggled: before all 11 keys give OBS_KEY_NONE, after each gives the expected key and label, NumLock on still gives NUM0..NUM9. built libobs. not tested in a Wayland session.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

With NumLock off, xkb reports the keypad keys as KP_Home, KP_End, KP_Up
and so on. They had no mapping, so they could not be bound as hotkeys.
Map them to the regular keys, like they behave on Windows, and KP_Begin
to Clear.

@kkartaltepe kkartaltepe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, seems to match Windows as stated.

@WizardCM WizardCM added kind/bug Categorizes issue or PR as related to a bug. platform/linux Categorizes issue or PR as affecting Linux specifically labels Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/linux Categorizes issue or PR as affecting Linux specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-numlocked numpad keys cannot be assigned as hotkeys under Wayland

3 participants