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

Java Development

Reply
Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Intercept lock key event?

Is there anyway to intercept the lock key event when I press the lock button on top of the bb to lock the screen?

 

 

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Intercept lock key event?

I don't believe so. I thought there was a listener for when the device is locked and unlocked but can't seem to find that if it exists.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Intercept lock key event?


rcmaniac25 wrote:
I don't believe so. I thought there was a listener for when the device is locked and unlocked but can't seem to find that if it exists.

I can use the garbage cleaner listener but i don't need to know if the device is locked. That function has never work reliable.  I want really want to do is disable the lock button so the system won't lock it.  I guess there wasn't much thinking at RIM part as feature wise for the button.  Would be nice if we can set the lock like the convienence key.

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: Intercept lock key event?

I think they put a lot of thought in it. For a company that prides itself on security, I doubt there will ever be a way to disable locking the device by allowing you to intercept and override the key.

Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Intercept lock key event?

the lock is not even security related.  it just locks the screen and if RIM had thought about it they would have given developers access to lock and unlock the screen.  I'm just talking about the screen and there is no security at all.  Every platform has access to screen lock.  it would nice if develop can replace the system screen lock.

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Intercept lock key event?

You can listen for the Keypad.KEY_LOCK key to be pressed with a KeyListener, though only with your application in the foreground.

 

In previous OSes, the lock button would actually lock the device, which obviously should not be interceptable. Now it puts it into standby mode, which disables the screen, ignores touch events and most keypresses (number keys and the buttons by the track pad will wake the device, telling you it's locked). This is to save battery life and prevent accidental pocket dialing and such.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Intercept lock key event?


PBernhardt wrote:

You can listen for the Keypad.KEY_LOCK key to be pressed with a KeyListener, though only with your application in the foreground.

 

In previous OSes, the lock button would actually lock the device, which obviously should not be interceptable. Now it puts it into standby mode, which disables the screen, ignores touch events and most keypresses (number keys and the buttons by the track pad will wake the device, telling you it's locked). This is to save battery life and prevent accidental pocket dialing and such.


thanks but i'm more interested in disabling the lock button if i can globally and not just in my app.

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Intercept lock key event?

Unfortunatly that is not supported.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Highlighted
Visitor
Posts: 1
Registered: ‎05-07-2012
My Device: 9300 Bold
My Carrier: Vodafone Australia

Re: Intercept lock key event?

[ Edited ]
I updated my 9700 bold when I first got it (2.5 years ago), and it wiped all info... So I never trusted it again, until last week. I'm blown-away how different the phone is now. Massive changes. So many I didn't want, but overall it's worth it. Having said that, I swear (I know) I had an option to disable the stupid lock button, and use the decade-old 2 key combo. Not anymore. And the button is worse than not having it at all. False security. The amount of days that I've pocket-dialled + texted random people is downright embarassing. I've spent years praising my blackberry. But this is a major gripe I have. That, and zero functional GPS service leaves me in the dark-ages, and unable to confirm I have a "smartphone". What sold me, when buying this phone was the line " you can customise 99% of the phone, to suit you". about time, i thought!   it's not a lock, as it simply does-not work. it's less than the traditional solution. it's a convenience button, that's not convenient + can't be re-mapped.   it should lead, follow, or get out of the way!