Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Hotkeys are not working #13

Open
ptrinh opened this issue Nov 2, 2021 · 2 comments
Open

Hotkeys are not working #13

ptrinh opened this issue Nov 2, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ptrinh
Copy link

ptrinh commented Nov 2, 2021

Example:

Command + [
Command + ]
Command + 1
Command + 2
...

@yannhodiesne yannhodiesne added enhancement New feature or request help wanted Extra attention is needed labels Nov 2, 2021
@beaugunderson
Copy link

any pointers here as to how these could be implemented? I've written Electron apps before but have no experience with the Discord codebase

@yannhodiesne
Copy link
Owner

@beaugunderson The Discord codebase is an obfuscated release of their React application, making it extremely challenging to hook to something inside the application's logic
Realistically, we cannot hook to their keyboard shortcuts settings to trick it into letting us configure it; because even if we manage to do it, as soon as they release an update of their codebase our feature will break horribly

What we can do is a list of hotkeys we want to support, and simulate user events to match their intended behaviors.
For example, Cmd + 1 should go to the first server of the sidebar, meaning we can look for this server's DOM element and trigger its onClick event.

Of course it will not be possible to get all hotkeys to work, but supporting a subset is better than nothing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants