Skip to content

[FIX] fix Keyboard shortcuts being activated globally rather than within heroic #2672

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

Conversation

Etaash-mathamsetty
Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty commented May 4, 2023

Unfortunately, we lose the custom shortcuts we created (but we retain the default ones, like reload, dev tools, quit, etc), but at least I don't have heroic stealing focus every time I press control-r

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)


// hotkey to open the downloads screen on frontend
globalShortcut.register('CommandOrControl+J', () => {
sendFrontendMessage('openScreen', '/download-manager')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we can add these shortcuts in the frontend shortcuts.ts file https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/blob/main/src/frontend/helpers/shortcuts.ts

that uses event listeners of the frontend so we can listen the combinations without having to deal with the menu or depending on electron features

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can always call electron functions when needed through window.api to still support the quit/devtools/reload commands

Copy link
Collaborator

Choose a reason for hiding this comment

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

I made another PR with that idea since it's reusing things removed from this PR #2684

we can keep all the new shortcuts while also making them local without relying on electron accelerators

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

Successfully merging this pull request may close these issues.

2 participants