Results 1 to 4 of 4

Thread: Is there a Qt function to convert Windows virtual key into Qt key code?

  1. #1
    Join Date
    Aug 2010
    Posts
    22
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.

  2. #2
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: Is there a Qt function to convert Windows virtual key into Qt key code?

    http://libqxt.bitbucket.org/doc/0.6/...lshortcut.html

    internally there maybe you can find what you want

  3. The following user says thank you to javimoya for this useful post:

    jezz (23rd December 2010)

  4. #3
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default 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

  5. The following user says thank you to Peppy for this useful post:

    jezz (23rd December 2010)

  6. #4
    Join Date
    Aug 2010
    Posts
    22
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default 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 View Post
    http://libqxt.bitbucket.org/doc/0.6/...lshortcut.html
    internally there maybe you can find what you want
    This is helpful, but I guess the one in Qt source is better.

    Quote Originally Posted by Peppy View Post
    Every key on keyboard is represented with ASCII, look at: http://brebru.com/asciicodes.html
    I think only part of the keyboard is represented with ASCII, eg A-Z, 0-9 etc.

Similar Threads

  1. how to convert qt3 code into qt4...
    By kamal in forum Qt Programming
    Replies: 1
    Last Post: 30th June 2010, 09:25
  2. virtual function
    By shenakan in forum Qt Programming
    Replies: 5
    Last Post: 26th August 2009, 10:25
  3. wrong virtual function called at some events on MacOS?
    By akos.maroy in forum Qt Programming
    Replies: 0
    Last Post: 3rd July 2009, 12:06
  4. problem with virtual function in a .h
    By mickey in forum General Programming
    Replies: 5
    Last Post: 19th April 2008, 19:57
  5. virtual overloaded functions and base class function call...
    By nouknouk in forum General Programming
    Replies: 7
    Last Post: 11th March 2006, 22:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.