ares-emulator / ares

ares is a cross-platform, open source, multi-system emulator, focusing on accuracy and preservation.
https://ares-emu.net
Other
962 stars 117 forks source link

[Feature Request] Cannot map ESC to Quit Emulator hotkey #1250

Open kathyrollo opened 1 year ago

kathyrollo commented 1 year ago

Describe the bug The ESC key cannot be mapped to the Quit Emulator hotkey in Settings.

To Reproduce

  1. Settings > Hotkeys > Quit Emulator > Assign
  2. Press ESC key.
  3. The key is not assigned.

Expected behavior ESC key should be a mappable hotkey.

Screenshots

Screenshot 2023-10-04 004729

Additional context ESC is commonly mapped to quit emulators. Very useful with popular frontends like LaunchBox to avoid using an AutoHotkey Script. Better as a native setting in the emulator to make sure it terminates elegantly.

Screwtapello commented 1 year ago

ESC is effectively mapped to "I don't actually want anything mapped to this function", chosen because it's something users are likely to hit out of habit if they accidentally start mapping the wrong thing.

Pretty much every other key on the keyboard is either (a) an even more frequently mapped key it would be a shame to lose, or (b) something nobody would ever guess to try as a "cancel" key.

I've seen key-mapping interfaces that use "backspace" for the "do not map anything" button, but in the context of emulators "backspace" is often used for the rewind or reset buttons.

I suppose ESC could be made mappable by reworking the key-mapping system to pop up a dialog with a clickable cancel button, but that would take some effort, and I forget if there was a good reason why Near didn't do that in the first place.

remutro commented 1 year ago

Workaround from Discord:

You can edit settings.bml. 0x1/0/0 binds the escape key for me on Windows 10.

The rightmost number should be the keyboard value. So, you should be able to take another binding using the keyboard and grab the two leftmost numbers.

kathyrollo commented 1 year ago

Hi @Screwtapello , thanks for responding. I figured it was more of a feature rather than a bug. In which case makes this more appropriate as a feature request. I have seen other emulators use mouse buttons if that makes the implementation easier without disrupting the current UI too much. Just to throw some possible options:

To avoid users guessing, a small UX improvement similar to the "Press a key or button" text beside the existing Assign and Clear buttons about the mouse-click functions can be displayed while no hotkey is awaiting assignment.


Hi @remutro , thanks I will have a look at the settings.bml file. If users are making a workaround for the behaviour, there could be enough rationale for its implementation.

With the exception of Ares, all emulators here that support hotkeys can natively use ESC key to quit:

Screenshot 2023-10-08 011011

I am also posting my AHK script workaround for LaunchBox if anyone needs it:

; Close emulator on ESC key
$Esc::
{
    WinClose, ahk_exe {{{StartupEXE}}}
}

Preferably, it is ideal not to resort to brute-forced workarounds. Cheers!

kathyrollo commented 1 year ago

You can edit settings.bml. 0x1/0/0 binds the escape key for me on Windows 10.

I tried this, worked in Win11 too. This is the next best workaround until it is implemented. I removed my AHK script. Thanks.