Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotkeys don't work on Linux #2805

Open
scurest opened this issue Dec 25, 2023 · 1 comment
Open

Hotkeys don't work on Linux #2805

scurest opened this issue Dec 25, 2023 · 1 comment

Comments

@scurest
Copy link
Contributor

scurest commented Dec 25, 2023

OS: Arch Linux
Frontend: RMG

Hotkeys don't work on my Linux laptop. Nothing happens when I press one.

I did a little investigation into why. The relevant file is src/osal/osal_keys_linux.c in the osal module.

There are two problems:

  1. osal can't find my keyboard. How this works is it looks for files of the form /dev/input/by-id/*kbd*.

    /dev/input/by-id is typically populated by USB devices. I'm using a laptop, not a USB keyboard, so my keyboard isn't listed there.

    Workaround: Plug in a USB keyboard. Alternatively, you can use the environment variable GLIDEN64_KEYBOARD to directly set the path to the device you want to use (eg. /dev/input/event3 for me).

  2. osal cannot open the device file after it finds it. fopen fails with a permission error.

    I believe this is a security hardening measure against keyloggers. I think programs are generally expected to get keypresses from X/Wayland instead of directly reading device files. See this forum thread.

    Workaround: I was able to fix this by adding myself to the input group (usermod -aG input scurest) and rebooting. See this. (Sudo will also likely work.)

Not sure how feasible these are to fix, especially (2), but hopefully this can at least be useful to someone else who has the same problem.

@Rosalie241
Copy link
Contributor

ideally I'd make a mupen64plus API which allows plugins to receive the state of the keyboard from the front-end, sadly though this was the best I could do at the time due to not coming up with a good API design, maybe this'll change in the future though!

I'm glad you were able to find the workarounds though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants