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
BadAccess when try to register Meida keys in linux #6
Comments
I'm afraid it's not a bug, but a limitation. As stated in the README, not all keys will work for all platforms. And as it seems, this is true for media keys on linux. This does not mean, it's impossible, but you can't use the Qt keycodes like As a solution, try find out the native keycode on linux, and try this one
If this still triggers an error, it is impossible to register the keys. |
Other things utilizing these keys use GNOME's daemon. You could look at how GNOME handles it. By the way here are the X keysyms for media buttons:
|
Closing, as it seems no further help is needed |
So, any solutions for this?
I get false on both. |
You have to create a native shortcut as
Thats an artifact of NativeShortcut originally beeing a private class, thus the validity does not get updates when settings the key/modifier directly... I shall fix that in the next release. After creating the native shortcut that way, at least the first line should return true. For the second one, there is once again no guarantee. If it works, it works. If not, it's not possible with the "normal" keygrabber API that is used by this library. |
Thanks, that did the trick. I do however need a way to get the keycode automatically from XF86MonBrightnessUp somehow (will do some reading, suggestions welcome). |
Hi,
I develop a simple audio player with Qt, now I have handle mediakeys like play/pause , next , previous and others but when try to register hotkeys a badaccess exception occur in code.
Is it a library bug ?
error message : QHotkey: Failed to register hotkey. Error: BadAccess (attempt to access private resource denied)
The text was updated successfully, but these errors were encountered: