3

How can I convert a Qt::Key (eg. Qt::Key_At) into nativeVirtualKey code outside of a keyPressEvent() or a keyReleaseEvent()?

frogatto
  • 28,539
  • 11
  • 83
  • 129
Junior
  • 507
  • 5
  • 19
  • Add some code fro what you have done and fials. – saeed Sep 16 '17 at 03:17
  • The case is simple. Inside a QKeyEvent you can get the corresponding nativeVirtualKey of pressed key with event->nativeVirtualKey()... but how I can get the corresponding nativeVirtualKey of aany Qt::Key outside of a QKeyEvent? – Junior Sep 16 '17 at 08:04
  • outside of QKeyEvent why outside? Describe more about the reason you need to handle key events outside QEvent handlers. – saeed Sep 16 '17 at 08:07
  • Add a code sample and describe where exactly you want native key handle – saeed Sep 16 '17 at 08:08
  • Even you can use a global variable and assign value to it – saeed Sep 16 '17 at 10:07
  • 1
    The [source for qxtglobalshortcut](https://github.com/mnutt/libqxt/blob/master/src/gui/qxtglobalshortcut_win.cpp) suggests you will have to create your own mapping. If there was a method that did reverse look-up, I'm sure libqxt would be using it. – ekhumoro Sep 16 '17 at 13:20

0 Answers0