Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qt::Key to Keycode on x11
Forum Updated to NodeBB v4.3 + New Features

Qt::Key to Keycode on x11

Scheduled Pinned Locked Moved 3rd Party Software
2 Posts 1 Posters 2.4k 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.
  • W Offline
    W Offline
    wgnm
    wrote on 11 Dec 2013, 17:12 last edited by
    #1

    I try to find a way to map dynamically and reliably an arbitrary Qt::Key to the corresponding Keycode (as defined in X.h).

    In QxtGlobalShortcut this is done by translating the Qt::key to a X.h Keysym with @XStringToKeysym(QKeySequence(key).toString().toLatin1().data())@
    and looking up the keycode with XKeysymToKeycode(). Hower, getting the correct string as input for XStringToKeysym() is more or less coincidence and it doesnt work for many keys (like space, dot, comma, ...).

    I'm sure there must be a better way.

    Can anybody help? Thanks!

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wgnm
      wrote on 14 Dec 2013, 16:44 last edited by
      #2

      Nobody?

      I forgot to mention that the needed keycode is returned by QKeyEvent::nativeVirtualKey(). But it doesn't work for "artificially" created key events. Is there a way to create them with this data included?

      1 Reply Last reply
      0

      1/2

      11 Dec 2013, 17:12

      • Login

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