Emulator Issues #13803
openUnable to bind virtual keypresses to hotkeys
0%
Description
What's the problem? Describe what went wrong.
I'm writing a small program which involves simulating keypresses. I am on Windows 10 with Dolphin 2503a. The program I'm writing is in Rust and uses the enigo crate for generating the simulated inputs. I'm trying to bind a simulated keypress (F5 key) to the hotkey Save Slot 1, and Dolphin is not registering the virtual keypress when trying to make that bind. A physical F5 keypress on my keyboard is just fine, but not the virtual one generated by my program. When I left click to try and use the Detect Input method, the emulator still does not register the virtual keypress at all. I've tried different keys to press (letters, not function keys) as well as running as administrator.
Curiously, the virtual keypresses are reacted to by the Dolphin UI. When I simulated the "F" key being pressed on a loop, clicking the "Emulation" menu does cause the simulated "F" presses to highlight "Frame Advance" and "Toggle Fullscreen". So Dolphin is seeing the virtual keypresses to some extent, but not enough to bind it to a hotkey - it seems? Other programs on my machine register the virtual keypresses just like physical keypresses - file explorer, web browsers, other emulators, Notepad++, etc. From what I've tested, only Dolphin has this interesting issue.
What steps will reproduce the problem?
I'm compiling with rustc version 1.86.0, and using enigo version 0.3.0. Writing a small program that simulates those keypresses, then attempting to bind with them in Dolphin should reproduce the issue. If requested, I'll happily share a repo and/or binary executable that does this so others can test and try to reproduce my issue.
Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.
Yes, I tried Dolphin 2503a-562 and the issue was still present
Is the issue present in the latest release? For future reference, please also write down the version number of the latest release.
Yes, the issue was present on Dolphin 2503a
What are your PC specifications? (CPU, GPU, Operating System, more)
OS: Windows 10
CPU: AMD Ryzen 9 5950X
GPU: NVIDIA GeForce RTX 3090
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
Not to my knowledge
Updated by Billiard26 1 day ago
- Related to Emulator Issues #12466: Pressing Alt + F4 loads the 4th savestate with the default hotkeys added
Updated by Billiard26 1 day ago
Dolphin currently uses DirectInput for keyboard input on Windows.
Whatever you are using to simulate key presses would have to work with that.
There's been thought to add an keyboard input backend to Dolphin using SDL or Qt for window message based keyboard input.
Doing that would make your simulated inputs work and could resolve some other system hotkey related issues (e.g. Alt+F4 in #12466).