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. Keyboard key values and State
Qt 6.11 is out! See what's new in the release blog

Keyboard key values and State

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

    Hi All

    I am using Qt in ubuntu linux.
    In my program I want to know the status of currently pressed key,that is pressed state ,released state or continuous state
    and pressed key value. How to achieve this?

    Thanks

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rschaub
      wrote on last edited by
      #2

      for that, you'll have to either implement an "eventFilter":http://qt-project.org/doc/qt-4.8/qobject.html#eventFilter and "install it":http://qt-project.org/doc/qt-4.8/qobject.html#installEventFilter, or reimplement the "keyPressEvent":http://qt-project.org/doc/qt-4.8/qwidget.html#keyPressEvent on a QWidget.
      The event you'll get in either of those two methods will hold the currently (or at the time of the event) pressed key.

      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