Search code examples
c++qtkeyboard-shortcutshotkeysregisterhotkey

Qt global shortcut extension hijacks shortcut


I am using this Qt extension that enables global short cuts (hotkeys) https://github.com/falceeffect/UGlobalHotkey

It works great, however if e.g. you enable the shortcut 'Ctrl+S' (Cmd+S on OSX) - the usual Save shortcut, and run this extension, it will hijack the shortcut and whatever application (Word/Sublime etc) you have in focus never receives the shortcut - EVEN WHEN the Qt app is NOT the focus.

My question(s) is/are:

  • how can an application take such control of a shortcut like this? Surely thats almost a vulnerability?
  • Can I 'pass' the shortcut back to the OS or to any other app that is in focus?
  • What order do shortcuts get registered?

My goal is to just passively recognise that Ctrl+S (Cmd+S on OSX) has been hit, but not hijack it in it's entirety


Solution

  • Alas this can't be done due to limitations of the OS https://github.com/Skycoder42/QHotkey#known-limitations