×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    3

    Grab Volume Keys on Harmattan

    Hi,

    is there a way to grab the volume keys on Harmattan while my application is active? Since there is no Hildon any more the way it used to work on Maemo 5 desn't work any more.

    Thanks

  2. #2
    Nokia Developer Expert
    Join Date
    Jul 2011
    Posts
    2

    Re: Grab Volume Keys on Harmattan

    Quote Originally Posted by mzanetti1 View Post
    Hi,

    is there a way to grab the volume keys on Harmattan while my application is active? Since there is no Hildon any more the way it used to work on Maemo 5 desn't work any more.

    Thanks
    Check out the QmKeys under QmSystem (http://library.developer.nokia.com/i...tem2/main.html).

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    3

    Re: Grab Volume Keys on Harmattan

    Quote Originally Posted by lavonius View Post
    Check out the QmKeys under QmSystem (http://library.developer.nokia.com/i...tem2/main.html).
    Thanks! This brings me a step closer.

    Afaics this docs only handle how to get the signals. Still I cannot figure out how to grab them (disable the system volumeUp/volumeDown) while the keys are handled by my app.

  4. #4
    Registered User
    Join Date
    Oct 2009
    Posts
    2

    Re: Grab Volume Keys on Harmattan

    Quote Originally Posted by mzanetti1 View Post
    Thanks! This brings me a step closer.

    Afaics this docs only handle how to get the signals.
    Actually volume keys act like regular keys. You need QmKeys only if you want to intercept volume buttons while your application is in the background.

    Quote Originally Posted by mzanetti1 View Post
    Still I cannot figure out how to grab them (disable the system volumeUp/volumeDown) while the keys are handled by my app.
    Use libresourceqt and acquire ScaleButtonResource. That will prevent the system or other applications from reacting to volume keys (assuming the resource acquisition was granted by the policy framework). Note also that you need to manually release that resource set when your application goes into background if you're paying attention only to volume key events (i.e. not subscribing to QmKeys).

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    2

    Re: Grab Volume Keys on Harmattan

    Quote Originally Posted by mgedmin View Post
    Use libresourceqt and acquire ScaleButtonResource.
    If you want an example, I've just figured all of this out for FBReader. Here's my patch (with some unrelated changes) and my story of how I figured this stuff out.

  6. #6
    Registered User
    Join Date
    Oct 2011
    Posts
    1

    Re: Grab Volume Keys on Harmattan

    Quote Originally Posted by mgedmin View Post
    Actually volume keys act like regular keys. You need QmKeys only if you want to intercept volume buttons while your application is in the background.



    Use libresourceqt and acquire ScaleButtonResource. That will prevent the system or other applications from reacting to volume keys (assuming the resource acquisition was granted by the policy framework). Note also that you need to manually release that resource set when your application goes into background if you're paying attention only to volume key events (i.e. not subscribing to QmKeys).
    Thank you very much for this information. This helps me out a lot by giving me more independent control over the volume of different applications. In addition, I find it to be very helpful to use noise cancelling headphones, I find that they help cut out a lot of the noise generated by the computer, making the sound cleaner and clearer, this way I can get by with a lower volume, which is very good on the ears.
    Last edited by Sheri; 2011-11-08 at 23:03.

Similar Threads

  1. Volume Keys on Nokia N8
    By abashir in forum Qt
    Replies: 3
    Last Post: 2011-03-31, 13:51
  2. Detecting volume keys
    By MatuX in forum Qt
    Replies: 3
    Last Post: 2010-09-10, 17:14
  3. Replies: 3
    Last Post: 2010-04-06, 16:11
  4. Different behaviours for external volume keys
    By Qman in forum [Archived] Flash Lite on Nokia Devices
    Replies: 0
    Last Post: 2008-05-14, 15:33
  5. Detecting volume up/down keys
    By AliShafa in forum Symbian
    Replies: 3
    Last Post: 2008-04-24, 11:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×