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.

inside custom component

Native Development

Reply
Developer
Posts: 30
Registered: ‎01-28-2014
My Device: BlackBerry Z10
My Carrier: Swisscom
Accepted Solution

LED as long as button pushed

Hi there! I'm happy to see you reading my question!

 

How can I develop (with QML) an app which is capablet to flash the front LED in cyan as long as the button is pressed?

 

Thank you for your answer!

Likian

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: LED as long as button pushed

check
https://developer.blackberry.com/native/reference/cascades/bb__device__led.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 30
Registered: ‎01-28-2014
My Device: BlackBerry Z10
My Carrier: Swisscom

Re: LED as long as button pushed

But what is the action? Is it onClicked {led.flash ()}?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: LED as long as button pushed

There is no LED object exposed to Cascades QML, so you would either need to expose a LED class yourself or call a function in your C++.

 

Take a look here for how to do this...

 

http://developer.blackberry.com/native/documentation/cascades/dev/integrating_cpp_qml/

 

Either way yes it would be in the onClick slot.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: LED as long as button pushed

Hi.

 

"as long as" means to me that you want to know when the button is being held down.

 

The clicked signal only shows you when it has been released. You may find one of the Gesture Handlers is suitable - you may need to connect to the touch signals.

 

Thanks,

 

 

--
Rob is no longer associated with BlackBerry.