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

WIP - Fix Hotkeys #8428

Open
wants to merge 6 commits into
base: master
from

Conversation

@jordan-woyak
Copy link
Member

jordan-woyak commented Oct 23, 2019

I've added support for hotkeys in our input expressions.

image

Fixes issue: https://bugs.dolphin-emu.org/issues/9320

Demonstration:
https://giant.gfycat.com/RapidScientificArgali.webm

Note the following improvements:

  • Button combos are now detected and do not require use of the "advanced" dialog.
  • Hotkeys suppress other references to the same input.
    • Ugly !Alt & Return mappings are no longer required to prevent regular press activation.
  • Hotkeys require pressing of modifers first.
    • e.g. Ctrl+O does not work unless you press Ctrl first.

The current syntax is of the form @(Ctrl+Shift+R) but I am open to suggestions.

Any input can be used as a "modifier". It is not limited to the typical ctrl, shift, alt.
This will make mapping button combinations on gamepads easier for users.

There is a disadvantage.. but I do not think it is horrendous.
@(Ctrl+O) Does not know Shift is a modifer unless a @(Shift+O) hotkey also exists.
In other words.. pressing Ctrl+Shift+O will present the "open file" dialog.
If you map something else to Shift+O, however, then it will not.


const bool modifiers_pressed = std::all_of(m_inputs.begin(), std::prev(m_inputs.end()),
[](const std::unique_ptr<ControlExpression>& input) {
// TODO: kill magic number.

This comment has been minimized.

Copy link
@lioncash

lioncash Oct 24, 2019

Member

Was this intended to be resolved in this set of changes or a future one? Disregard, I missed the "WIP" in the title :p

This comment has been minimized.

Copy link
@jordan-woyak

jordan-woyak Oct 24, 2019

Author Member

Yeah. Another PR moves the relevant constant to a header file. Didn't feel like dealing with merge conflicts.

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:better-hotkeys branch from 5bda7f7 to 946d4dc Oct 24, 2019
@jordan-woyak jordan-woyak force-pushed the jordan-woyak:better-hotkeys branch from 1fd9310 to 1233276 Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.