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 ?
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 145 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on 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

    Pl45m4P 1 Reply Last reply
    1
    • sonichyS sonichy

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

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on 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

      • Login

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