Activate app window on keyboard shortcut #15369
-
Hello, community! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can't handle global keyboard events, if your app isn't focused. If that's what you want. |
Beta Was this translation helpful? Give feedback.
-
Depending on your use case, it's also possible to just parse the keyboard data directly on Linux, which will work on X11 and Wayland without issue. It's just a file after all. But you need root/permission to read the file. It also contains binary data so you will need to convert it into something useful yourself. |
Beta Was this translation helpful? Give feedback.
You can take a look at Sharphook.
https://github.com/TolikPylypchuk/SharpHook
I can't say I have ever tried it. As I mentioned before you can poll the raw keyboard data, but you likely wont have permission to do that. Otherwise you can use x11 APIs.But the more modern way which is also not guaranteed to work since its up to desktops to implement is via the keyboard shortcut portals. Which seems to be implemented in KDE (not sure about other desktops).