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

Global Shortcut for any key #16803

Closed
woniesong92 opened this issue Feb 7, 2019 · 4 comments
Closed

Global Shortcut for any key #16803

woniesong92 opened this issue Feb 7, 2019 · 4 comments

Comments

@woniesong92
Copy link

Is your feature request related to a problem? Please describe.
I want to create an app that listens to keyboard events (e.g. keylogger).

Describe the solution you'd like
I want to use a Global Shortcut to listen to keyboard events when my electron app is out of focus.

Describe alternatives you've considered
Write a native app without Electron

Additional context
I haven't found a way to listen to keyboard events when the app is not in focus. Is there already a way to do so?

@welcome
Copy link

welcome bot commented Feb 7, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@MarshallOfSound
Copy link
Member

(e.g. keylogger).

Yeah, we aren't going to help you make a keylogger 😄 The globalShortcut API is deliberately designed to absorb keypresses so that they are for shortcuts and don't pass-through to other applications. This use case is not something we're planning on supporting

@woniesong92
Copy link
Author

Thanks for the answer! I actually want to build a text macro tool where you can store text snippets under short strings (e.g. type "he" to output "hello world"). So to build something like this, Electron is out of question? Sorry if this is asking the same question.

@akoskm
Copy link

akoskm commented Aug 3, 2022

@MarshallOfSound I need this too but for a companion app for writers. Other apps do this as well:

image

I believe Discord is also an Electron app. Is this still not possible to do with Electron?

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

No branches or pull requests

3 participants