Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Difference between virtualKey and keyCode?



  • I'm working on a program which needs to support both English and Japanese keyboard.

    but no matter which keyboard I'm using, the program functions as if it is always the english keyboard.

    I debugged the code and noticed that in the keypress event, we use nativeVirtualKey() instead of key(). while the key() reflects the keyboard type, the nativeVirtualKey() seems to return the same code for both keyboards.

    I can't tell the difference between nativeVirtualKey and key? I don't know when to use which one? And what is worse, there is a scan code also.


Log in to reply