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. QML, Keys.onPressed
QtWS25 Last Chance

QML, Keys.onPressed

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 6 Posters 8.5k 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.
  • B Offline
    B Offline
    borut123
    wrote on last edited by
    #1

    Hi

    Is it possible to detect volume up/down keys in QML on Symbian 3?
    I've been trying to get any key press feedback in QML. But nothing happens, no key event is triggered at all.

       Keys.onPressed: {
            console.log("key has been pressed");
        }
    

    Although, on Windows 7 the same QML code works as expected.

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

      To answer your first question. No, hardware volume keys are not currently mapped to Qt::Key_volumeUp/Down.

      If you don't get any feedback on any key presses you should file a bug for S^3.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moo1
        wrote on last edited by
        #3

        I have the same issue on Symbian 3 (N8), and it seems even Qt C++ cannot receive key events for volume up/down! Can anyone explain why???

        1 Reply Last reply
        0
        • M Offline
          M Offline
          moo1
          wrote on last edited by
          #4

          Okay, I did some search and found a bug report for this "Enable key capture and remcon interfaces for Qt apps on Symbian":http://bugreports.qt.nokia.com/browse/QTBUG-4415 , but this looks like left for more than a year and doesn't look promising.

          Meanwhile, I did some more search and it seems only way is to use "Symbian Remote Control API":http://wiki.forum.nokia.com/index.php/TSS000432_-_Utilising_media_keys and somehow wrap it as QDeclarativeItem. I'm happy to share the code snippet if somebody is interested but not sure where's the proper place.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            borut123
            wrote on last edited by
            #5

            You could use the Symbian Remote Control API to catch keypress events in C++ and then send signals to QML.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mario
              wrote on last edited by
              #6

              moo1: Place the code on the wiki

              1 Reply Last reply
              0
              • M Offline
                M Offline
                moo1
                wrote on last edited by
                #7

                I created a new wiki entry and put code there. "Getting Audio Volume Key Event on Symbian Devices":http://developer.qt.nokia.com/wiki/AudioVolumeKeyEventOnSymbian

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  ezust
                  wrote on last edited by
                  #8

                  That link seems to be no good. Try to upload again, and maybe put some text on the page too, please?

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    parancibia
                    wrote on last edited by
                    #9

                    Try this link "Getting Audio Volume Key Event on Symbian Devices":http://developer.qt.nokia.com/wiki/Audio_Volume_Key_Event_On_Symbian , the next time use the search function of the Wiki.

                    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