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. Shield Key Arrow and Space
Qt 6.11 is out! See what's new in the release blog

Shield Key Arrow and Space

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 436 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    I am writing a program of keyboard test.
    https://github.com/sonichy/KeyboardTest
    alt text
    How to shield arrow keys of move between QWidgets and space of press QPushButton ?
    And distinguish left and right same fuction key (Ctrl, Alt, Shift, win) ?
    And distinguish numpad key ?

    https://github.com/sonichy

    Pablo J. RoginaP 1 Reply Last reply
    0
    • sonichyS sonichy

      I am writing a program of keyboard test.
      https://github.com/sonichy/KeyboardTest
      alt text
      How to shield arrow keys of move between QWidgets and space of press QPushButton ?
      And distinguish left and right same fuction key (Ctrl, Alt, Shift, win) ?
      And distinguish numpad key ?

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @sonichy given that you're using standard QKeyEvent class, I'd say you may want to derive from it and create your own MyKeyEvent where you can distinguish between left and right Shift keys and so on.

      You'll also may want to specialize the Qt::Key enum to add Qt::Key_Shift_L and Qt::Key_Shift_R and so on.

      Then, in your mainwindow.cpp whenever you detect the left Shift key is pressed you'll use your extensions.

      In any case, I wonder why you need this given that the Qt developers did not so far, and they have already abstracted the keyboard functionality of several OS...

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      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