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

InputCommon: Add hotkey support to input expressions. #8428

Merged
merged 11 commits into from Sep 26, 2020

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak 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.
    • Simultaneous and successive presses also produce & and | operator usages.
  • 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.

@jordan-woyak jordan-woyak force-pushed the better-hotkeys branch 2 times, most recently from 1fd9310 to 1233276 Compare October 27, 2019 13:55
@jordan-woyak jordan-woyak changed the title WIP - Fix Hotkeys InputCommon: Add hotkey support to input expressions. Feb 16, 2020
@jordan-woyak jordan-woyak force-pushed the better-hotkeys branch 2 times, most recently from 8c37ffd to 593de5e Compare February 25, 2020 22:29
@iwubcode
Copy link
Contributor

Very nice @jordan-woyak ! No real concerns with the code on an initial pass.

I did a bit of testing. Seems like a massive step up. For button combos, the hotkey vs "|" seems to give me what I expect part of the time. I need to increase my dexterity :)

I plan on coming back and testing the hotkey suppression + giving the code another once over before the final review.

@jordan-woyak jordan-woyak force-pushed the better-hotkeys branch 2 times, most recently from c5a00b9 to 1f20d96 Compare August 31, 2020 00:47
for (auto& modifier : *modifiers)
++m_suppressions[{(*final_input)->GetInput(), modifier->GetInput()}];

return Suppressor(std::make_unique<std::function<void()>>([this, modifiers, final_input]() {
Copy link
Contributor

@iwubcode iwubcode Sep 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine but I was surprised Dolphin doesn't already have a scoped-lambda type thing, always found the unique_ptr approach to be too terse for my liking

Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@JMC47
Copy link
Contributor

JMC47 commented Sep 26, 2020

Well, I needed something big for the GUI section anyway and hotkeys are fun.

@JMC47 JMC47 merged commit c64d41d into dolphin-emu:master Sep 26, 2020
10 checks passed
@jordan-woyak jordan-woyak deleted the better-hotkeys branch September 26, 2020 04:44
@i30817
Copy link

i30817 commented Sep 26, 2020

I'm not sure i should ask this here, but since i don't have a account in the real bug report page a merged issue that touches this recently is the best i can do.

Anyway: would it be possible to make a way to 'lift a finger' automatically recenter the wii pointer?

I'm doing something where the touchpad is the wii pointer and a modifer(right touchpad button)+the touchpad is the tilt.

This works fine, but when i stop using the tilt shortcuts, the wii cursor shortcut activate and jump the mouse to where the 'cursor' is, while i'd prefer it was kept in the same position as it was move the tilt movement.

Part of the problem is that the cursor is not recentered after i release the modifier.

I wonder if it's possible to add a controller 'hotkey' to the motion simulation screen which is not part of the 'gestures of the controller' and just triggers some 'function' when a button is pressed or released and calls functions like 'recenter wii cursor' that have nothing to do with a predefined gesture the controller functions.

Then i could have the tilt and when releasing the modifier call a 'recenter cursor' function. That function would have to exist ofc. I'm not sure how it would work in practice and if i would have to lift up the finger touching the touchpad before releasing the modifier (because the cursor moves anyway to the projected absolute touchpad coordinates on the screen), but it seems something like this could be useful to minimize cursor drift on 2d simulations of 3d movements.

@jordan-woyak
Copy link
Member Author

@i30817 Ask on the forums. Also I can't figure out what you're asking for.

@i30817
Copy link

i30817 commented Sep 26, 2020

You're right, i probably should make sure it's actually a important issue in a game before i ask for this. I thought of it because the tilt is often used to control the camera and using the tilt and the pointer at the same time could be important to games that use a simulation of archery for example, but on second thought it's kind of unlikely though maybe it happens with the nunchuck accessory.

ronniedude added a commit to ronniedude/EmuDeck that referenced this pull request Jul 11, 2022
…tkeys as in-game button presses

Using the @ operator added to dolphin for input expressions enhancement: dolphin-emu/dolphin#8428
dragoonDorise added a commit to dragoonDorise/EmuDeck that referenced this pull request Aug 6, 2022
* 0.17.6

* Renaming icon so people know its for updating emudeck

* Renaming icon so people know its for updating emudeck

* Citra Fix

* appImage fix

* Yuzu fix for '

* WiiU steam-rom-manager glob update (#267)

Previously was missing the period in the extensions and was only looking for lower case.

* no WGET

* no WGET

* Fixed Dolphin (& Primehack) from sending button presses as part of hotkeys as in-game button presses

Using the @ operator added to dolphin for input expressions enhancement: dolphin-emu/dolphin#8428

* win600 fix

* 16:9 bezel adjustment

* fix AR detection script

* 16:9

* Bezel fixes

* Fixes bezels

* Fixes Bezels Deck

* More Bezels + Yabause on ESDE

* Yabause

* CHDDeck now finds and removes files from gdi and cue (#270)

chdman script has been updated to properly parse gdi and cue files.
chdman script has been updated to use the dolphin-tool binary from the DolphinEmu install.

* docs

* Adds GitHub Actions linting (#247)

Creates GitHub Actions linting. I know this will fail, but it's good to get it in.

* add -x for sourcing shellcheck

* update shellcheck

Only yell about errors

* YabaShanshiro bezels

* test reset

* sourcing settings again

* source of the right file

* typo

* typo2: The return

* no &

* Beta discord action

* always update romsdirectory in ESDE

* Emu reorg (#271)

the big one - Complete reorganization of the structure of the script.
Fixed a few bugs:

Files are backed up prior to replacement.
Retroarch configs are now applied by merge instead of replace. We'll set our configurations in the config files, but we won't completely overwrite your configurations. Instead we'll append and update as needed.
Users who have certain special characters in their password will no longer break RetroAchievements.
Added PID lock so script can't run more than once concurrently.
Changed all wget to curl so that users who don't have wget(??) don't have issues.
Added a few new bezels and shaders for RetroArch.
Support more aspect ratios for non-deck devices
use $HOME in the SRM config so non-deck users don't have to update it.
add Naomi(flycast) support to SRM

* add gitpod (#265)

Add Gitpod Manjaro

* fixed typo in 3ds ROM formats .cii to .cci (#276)

* fixed typo in 3ds ROM formats .cii to .cci

* added compatibilitytools.d (proton-ge) support

* Add pcsx2qt appimage (#287)

add emuDeckPCSX2QT
add pcsx2qt config
add pcsx2-qt parser
make moveSavesFolder fn
use moveSavesFolder to link stuff

* Fix PCSX2-QT SRM roms path
fix roms quoting for script

* Add PCSX2QT to install script

* update pcsx2qt hotkeys

* Left Shoulder / Right Shoulder

* move functions to helperFunctions

* mess with dockerfile

* take trailing slash out of biosPath

* take trailing slashes out of emulationPath

* take trailing slash out of romsPath

* update esde functions

* log change line

* small log change

* fix xemu updates to include single quotes in paths.

* change setSettings for better logging
change up the password logging

* add pcengine and pcenginecd parsers

* create createDesktopShortcut fn

* binup and chd use new shortcut fn

* toolsPath/

* Rearrange init in script to make pull make sense

* toolsPath no more trailing Slash

* Fix BinUpdate desktop icon

* add pcsx2-qt widescreen choice
update pluginloader / powertools to new versions

* add pcsx2-qt variables to settings.sh

* no more markdown linting

* formatting

* add pcsx2-qt appimage to binupdate

* take out / from savesPath

* remove trailing slashes from $storagePath

* fix SRM Parser: Nestopia --> mesen

* add easyRPG core

* fix setSettings file name for append.
changed how the pull works, so it resets and sets the appropriate branch

* begin cli only

* add dialogBox to all

* move pull

* git brach change

* source whole set of functions before beginning

* Get raw jq. Make changeLine only search with start of line char

* shellcheck!

* update yuzu bios msg with \

* add a bunch of logs

* fix psp path

* use --ignore-existing on cemu in update

* change unlink in yuzu. correct variable for uninstall.

* fix pulling

* log out installEmuAI

* add all setup variables to Easy Mode defaults

* add addition file download for emuDeckRetroArch.sh

* easyRPG added. Dl Additional Files for cores.

* made a settings validator

* take out fake setting for testing

* shortcut making

* add icons

* remove setSettings

* Cemu Icon

* Fix emu / reinstall selections.

* take out CHDMan flag

* sudo features ONLY in expert mode

* Mupen64Plus-Next: Changed default controller pak back to "memory"

* change casing of icons

* retain cemu.sh final line modifications

* backup retroarch configs before merging ours

* update documentation

* remove / from toolspath in chdman script

* fix chdman array

* Turn on Terminal for Compression script

* Turn on Terminal for Compression script (#299)

* moved old pcsx2 to -legacy. new pcsx2 replaces the parserID

* name the legacy a bit better?

* pcsx2 parser swap (#300)

* Turn on Terminal for Compression script

* moved old pcsx2 to -legacy. new pcsx2 replaces the parserID

* updated latest to be more compact

* Fix install not working when backend exists, but is empty

* move yuzu finalize to yuzu init / update

* update yuzu speedlimit to 100%

* keep terminal open with binary updater

* binary updater now sources the functions and vars.
binary updater reports what it did afterwards.

* Dev (#303)

* Turn on Terminal for Compression script
* Turn on Terminal for Tool updater
* Tool Updater reports what it did afterwards.
* moved old pcsx2 to -legacy. new pcsx2 replaces the parserID

* updated latest notes to be more compact so we don't run off screen
* Fix install not working when backend exists, but is empty
* Update Yuzu speedlimit to 100%
* binary updater now sources the functions and vars.

* wonderswan no bezels

* PCSX2QT ws_cheats - commented

* Revert "PCSX2QT ws_cheats - commented"

This reverts commit 657479b.

* Win600 Bezel fixes

* branch names, allow minusc

* fix binup cemu update

* Add emudeck savesync (#306)

* add emuDeckSaveSysnc fn

* create service.

* add expert mode option for savesync

* flatpak update new UI

* doSetupSaveSync to settings.sh so we can activate this on the new UI

* Ryujinx Config

* Ryujinx Config

* Ryujinx launcher + SRM

* Fix ryu

* Ryujinx disabled

* Duckstation 16:9

* Duck Wide fix

* Flycast wide fix

* Fix sync cloud

* changelog

* Fix flatpak update

* Request: Add ZX Spectrum support to EmuDeck/Steam Rom Manager setups #289

* add emulation path to savesync

* Preserve SRM custom artwork

* docs

* Documentation Updates #261

* cheevos off but commented

* Mesen HD packs

* fix path mesen pack

* Mesen HD Packs

* Can we add recursive rom parsing tips somewhere? #232

* docs

* analog stick to mirror the d-pad controls for older systems #213

* docs

* cloudsync doc

* Re-add PCSX2-QT parser

* Re-add PCSX2-QT parser (#307)

* cloudProviders ShellCheck and Zenity output

* fix flatpakupdate logic / variables

* download and extract easyRPG bios files from their site

* set steamdir and romsdir in usersettings

* Fix Ryujinx

* Ryujinx!

* Ryujinx fixes ESDE and installation

* add mame flatpak support (#313)

add Mame Flatpak Support

* fix expert mode selections not applying when false

* refresh sudo cache before running sudo commands

* add some  unlinks before links
esde_update instead of init

* add mame settings to default file
fix settings cat before beginning

* sleep 20 seconds before doing the service

* add mame launcher

* Dev to beta (#314)

Added Ryujinx binary Support

Added Mame Flatpak Support

Co-authored-by: Rodrigo <rodrigosedano@me.com>

* add ryujinx to all.sh

* add desktop shortcut for installEMuBI

* Fix slash direction

* no trailing slashes in path variables

* clean up dupes

* remove duplicates fom settings file. Also now use =

* default old pcsx2 to off

* take out recursion for ESDE (was picking up other appimages)

* Add Mame SRM Parser

* Fix PCSX2QTWide variable

* re-add Theme Picker

* language

* move theme pick into expert mode settings

* apply esde theme in customizations

* Rename ryujinx.svg to Ryujinx.svg

* change the install to use find for the scripts

* fix desktop path

* add ryujinx to binary updater

* put creation inside loop for scope

* fix yuzu in binup

* add bios and bios/mame to mame rompath variable
will allow people to split bios for srm
will not work for ES-DE as it passes in
rompath

* update mame controls

* quick mame config change

* Update latest.md

* Update version.md

* relabel all the arcades as RetroArch where appropro

* fix esde theme application

* Change name of pcsx2 to pcsx2-legacy

* SaveSync not in Main

* typo

* update roms path Ryujinx

Co-authored-by: Rodrigo <rodrigosedano@me.com>
Co-authored-by: Michael Gorman <michael@michaeljgorman.com>
Co-authored-by: ronniedude <37117448+ronniedude@users.noreply.github.com>
Co-authored-by: Dylan Tackoor <mynameisdylantackoor@gmail.com>
Co-authored-by: Merith <merith.tk@gmail.com>
Co-authored-by: BillCipher-exe <hakanbaser@hotmail.de>
Co-authored-by: Madeline <maddie@mewmews.gay>
Co-authored-by: Narcha <42248344+Narcha@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants