Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    QKeyEvent key as string

    General and Desktop
    2
    2
    3563
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      torsten last edited by

      Hello,

      I'm looking for an option to show a user his assigned keys.
      The problem is to get a string of the key values, like Qt::CTRL to "Ctrl" or Qt::ALT to "Alt".
      event->key() correctly gets the value, but event event->text() work only for characters, not for CTRL, ALT, etc..

      1 Reply Last reply Reply Quote 0
      • B
        blex last edited by

        Probably, this may help.

        enum Qt::KeyboardModifier contains only 7 values. Analyze the QKeyEvent::modifiers() and append the corresponding string.


        Oleksiy Balabay

        1 Reply Last reply Reply Quote 0
        • First post
          Last post