Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint
Accepted Solution

Qt (not Cascades) and Play/Pause Button

Does anyone know how to capture the Play/Pause Button with Qt? I tried looking for it in a keyPressEvent like I do for the swipe-down menu but nothing gets triggered there.

 

Thanks

Nic

Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Qt (not Cascades) and Play/Pause Button

Anybody have an idea? I thought I would bump this after the weekend. Something that may be of interest (and possibly part of the problem) is that when I use Qt Mobility I get an error message in my log: 

Unable to request multimedia events 

 

Anybody now why that would happen? This error is coming the from the standard mmrender_request_events function. Is there a permission/action I need to have? I have this right now:

 

<action system="true">run_native</action>
<action>access_shared</action>
<action>set_audio_volume</action>
<action>play_audio</action>

 

Interestingly I am prompted to accept the file permission but nothing is asked of the audio permissions.

 

Thanks

Nic

Please use plain text.
BlackBerry Development Advisor
anhu
Posts: 53
Registered: ‎10-26-2011
My Carrier: Rogers

Re: Qt (not Cascades) and Play/Pause Button

Hi, 

 

It’s being investigated internally.  Please log a Feature Request in JIRA and then post the JIRA Item URL back to this thread so we can help you monitor the status of your request. 

 

Anthony

Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Qt (not Cascades) and Play/Pause Button

Thanks. Where do I log a Feature Request at?

Nic
Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Qt (not Cascades) and Play/Pause Button

Please use plain text.
New Contributor
seanharmer
Posts: 3
Registered: ‎09-20-2012
My Carrier: O2

Re: Qt (not Cascades) and Play/Pause Button

Hi,

 

Support for hardware buttons is now available in Qt 4.8 and Qt 5. See

 

https://codereview.qt-project.org/#change,34304 (Qt5)

https://codereview.qt-project.org/#change,34954 (Qt4)

 

The hardware buttons are mapped to Qt Key press events:

 

bid_minus -> Qt::Key_VolumeDown

bid_playpause -> Qt::Key_Play

bid_plus -> Qt::Key_VolumeUp

bid_power -> Qt::Key_PowerDown

Just override Qwidget::keyPressEvent() or QObject::event() as usual or use an eventFilter to respond to these events.

Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Qt (not Cascades) and Play/Pause Button

Awesome! I tested this today and it works as expected.

 

Thanks!

Nic

Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Qt (not Cascades) and Play/Pause Button

Is it possible to receive key events when the app is not in focus? I lose them when I switch to another app or if the PlayBook goes to standby.

 

Thanks

Please use plain text.
New Contributor
seanharmer
Posts: 3
Registered: ‎09-20-2012
My Carrier: O2

Re: Qt (not Cascades) and Play/Pause Button

Good question. The honest answer is that I am not sure at the moment. I'll take a look.

Please use plain text.