Is there a Qt function to convert Windows virtual key into Qt key code?
I am creating a global key hook program, and I want to abstract my key processing. So I would want a function to convert platform keycode into Qt key code. For example, convert Windows virtual key into Qt key. For example: int convertToQtKey(int virtualKey)
Calling convertToQtKey(27) should return Qt::Key_Escape.
I googled and also searched Qt Assistant but found nothing.
Thanks.
Re: Is there a Qt function to convert Windows virtual key into Qt key code?
Re: Is there a Qt function to convert Windows virtual key into Qt key code?
Every key on keyboard is represented with ASCII, look at: http://brebru.com/asciicodes.html
Re: Is there a Qt function to convert Windows virtual key into Qt key code?
Thanks, I found suitable functions and a table in C:\Qt\4.7.1\src\gui\kernel\qkeymapper_win.cpp
Quote:
Originally Posted by
javimoya
This is helpful, but I guess the one in Qt source is better.
Quote:
Originally Posted by
Peppy
I think only part of the keyboard is represented with ASCII, eg A-Z, 0-9 etc.