Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QKeyEvent key as string
Qt 6.11 is out! See what's new in the release blog

QKeyEvent key as string

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.2k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      blex
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved