Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] EV_KEY KEY_POWER not showing.
QtWS25 Last Chance

[SOLVED] EV_KEY KEY_POWER not showing.

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.8k 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.
  • I Offline
    I Offline
    ivokosir
    wrote on last edited by
    #1

    Hi,

    I want to use special controller with my program on linux, and one of buttons is KEY_POWER, but when i press that button nothing is registered in Keys.onPressed.

    Output of evtest on my input event is:

    @Event: time 1409863923.712355, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10081
    Event: time 1409863923.712355, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
    Event: time 1409863923.712355, -------------- EV_SYN ------------@

    How do I catch that event in qt?

    I am using arch linux with latest package.

    EDIT: just found out this might be solved "bug":https://bugreports.qt-project.org/browse/QTBUG-40840?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab

    My build was was before "patch":https://qt.gitorious.org/qt/qtbase/commit/c0429719c1a28bb1a0d88862b3a8c84525ee9a48 , so i will try to build from source, sorry for inconvenience.

    EDIT: works after patch

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nologinma
      wrote on last edited by
      #2

      To tack the button pressed you are using the following code:

      @void test::keyPressEvent(QKeyEvent* event)
      {
      qDebug() << event->text();
      event->ignore();

      }@

      please can you share your code ?

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ivokosir
        wrote on last edited by
        #3

        Sorry, i just forgot to install after compiling... It is working now.

        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