6

Is there a way to convert back from Qt::Key to the native keyboard code (either scan code or virtual key code)?

QKeyEvent has two methods:

nativeScanCode () const
quint32 nativeVirtualKey () const

So somewhere there needs to be a mapping between the native code and the Qt:Key . I am looking for the inverse function Qt:Key -> native code

According to " How to convert a Windows native virtual key code to Qt::Key? " I would expect the mapping in qt\src\gui\kernel\qkeymapper_win.cpp but this file does not exist in my src path (Qt 5.2).

-- Edit (Samoth's answer) --

I am able to locate the files now, silly mistake on my side. What I am really looking for is a way to

  1. either convert Qt:Key to native / virtual code
  2. or vice versa

Unfortunately I did not find this method so far.

Community
  • 1
  • 1
Horst Walter
  • 13,663
  • 32
  • 126
  • 228

0 Answers0