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. How to distinguish Left-Shift and Right-Shift in QShortcut ?
QtWS25 Last Chance

How to distinguish Left-Shift and Right-Shift in QShortcut ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 139 Views
  • 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.
  • S Offline
    S Offline
    sonichy
    wrote on 7 Mar 2024, 15:25 last edited by
    #1

    Like this:
    connect(new QShortcut(QKeySequence(Qt::SHIFT_Left + Qt::Key_Down), this), SIGNAL(activated()), this, SLOT(moveBottomDown()));

    https://github.com/sonichy

    P 1 Reply Last reply 7 Mar 2024, 15:51
    1
    • S sonichy
      7 Mar 2024, 15:25

      Like this:
      connect(new QShortcut(QKeySequence(Qt::SHIFT_Left + Qt::Key_Down), this), SIGNAL(activated()), this, SLOT(moveBottomDown()));

      P Online
      P Online
      Pl45m4
      wrote on 7 Mar 2024, 15:51 last edited by
      #2

      @sonichy said in How to distinguish Left-Shift and Right-Shift in QShortcut ?:

      connect(new QShortcut(QKeySequence(Qt::SHIFT_Left + Qt::Key_Down), this), SIGNAL(activated()), this, SLOT(moveBottomDown()));

      Unfortunately there is no difference in QKey between left and right shift. There is only Qt::ShiftModifier.

      In this topic here they suggest to use the OS native key codes / events.

      • https://forum.qt.io/topic/36639/read-keyboard-input-that-can-differ-between-left-shift-and-right-shift-key

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3

      2/2

      7 Mar 2024, 15:51

      • Login

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