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. To use QKeySequence or an alternative to it
Forum Updated to NodeBB v4.3 + New Features

To use QKeySequence or an alternative to it

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • D Offline
    D Offline
    dawidow
    wrote on last edited by
    #1

    I have a current need that I need to be able to construct key sequences as and when a key is pressed (that includes the modifier). Currently QKeySequence does not handle my requirement but am using it such that its being constructed everytime a key is pressed or released. Also another thing that I noticed is that when only the modifiers are pressed (which is a valid case in my requirement), I should be able to generate a valid QKeySequence, however it does not until there is a non-modifier key (anything other than Ctrl/Shift/Alt/Meta).
    Also it would be ideal to say have QKeySequence::addKey(key) [that will add a key to the current sequence] and QKeySequence::removeKey(key) [that would remove an existing key from the key sequence] to extend it.

    It would be great if anyone could let me know to get this work with QKeySequence or an alternative.

    Thanks.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dawidow
      wrote on last edited by
      #2

      or in other words, I need a simple key container which can be used straight in mapping to actions (not QAction, just a function call maybe)

      @if (seq1) do this
      else if (seq2) do that
      ...
      @

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AcerExtensa
        wrote on last edited by
        #3

        maybe reimplementing
        "keyPressEvent":http://doc-snapshot.qt-project.org/4.8/qwidget.html#keyPressEvent

        will help you...

        God is Real unless explicitly declared as Integer.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dawidow
          wrote on last edited by
          #4

          yup, already re-implmented keyPressEvent, still needed a simpler container to map the key sequence (order does not really matter).

          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