obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.89k stars 7.76k forks source link

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

Open jonhoo opened 1 year ago

jonhoo commented 1 year ago

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

Git

OBS Studio Version (Other)

ga4834efde

OBS Studio Log URL

Nothing relevant in logs

OBS Studio Crash Log URL

No response

Expected Behavior

The numpad End key is assigned to the chosen action.

Current Behavior

Nothing happens. The input field remains blank.

Steps to Reproduce

  1. Run a Wayland compositor (I'm using Hyprland)
  2. Turn off num-lock
  3. Run wev
  4. Press the "1" key on the numpad
  5. Notice that it records that the button KP_End was pressed (distinct from the End key)
  6. Close wev
  7. Open OBS
  8. Open Settings -> Hotkeys and select the input field for an unassigned action
  9. Press the "1" key on the numpad

Anything else we should know?

Numeric inputs from the numpad work just fine (like "1" with num lock turned on). The equivalent non-numpad keys work fine (like the regular "End" key).

It could be that Hyprland is doing something weird in how it handles num lock (see https://github.com/hyprwm/Hyprland/issues/2682 for example), but given that wev produces the expected output I don't think this is related to Hyprland.

kkartaltepe commented 1 year ago

We dont map special keypad face buttons (see: https://github.com/obsproject/obs-studio/blob/578dc46a797db8860e90789741bae40441d18575/libobs/obs-nix-wayland.c#L1027 )

Someone would need to add these or convince xkb to do the mapping back to the non-keypad versions.

jonhoo commented 1 year ago

Thanks for the pointer! So that means it would need to be added to: https://github.com/obsproject/obs-studio/blob/578dc46a797db8860e90789741bae40441d18575/libobs/obs-hotkeys.h#L102-L118 https://github.com/obsproject/obs-studio/blob/578dc46a797db8860e90789741bae40441d18575/libobs/obs-nix-wayland.c#L1027-L1063 https://github.com/obsproject/obs-studio/blob/578dc46a797db8860e90789741bae40441d18575/libobs/obs-nix-x11.c#L312-L345 https://github.com/obsproject/obs-studio/blob/578dc46a797db8860e90789741bae40441d18575/libobs/obs-hotkey.c#L1353-L1368

Anywhere else?

kkartaltepe commented 1 year ago

a9641940cb8b2fad47a0dfe242e409cf274afcca is the last addition of new keys.

Whether they should be their own keys or map into normal end/pgdn/etc im not sure. Id probably just map them to the normal keys and not add extra keys. You should probably see what occurs in windows/mac for the same keys.