BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Background application that listens on keypad. (http://www.blackberryforums.com/developer-forum/263592-background-application-listens-keypad.html)

abhsax1978@hotmail.com 02-25-2013 04:44 AM

Background application that listens on keypad.
 
Hello everyone,
I am trying to create an application targetting 5.0 devices, that will enable the backlight when a sequence of characters are typed on nowhere, but keypad.

Any gueses how to implement a listener in an application like that?

Thanks in advance.

Dougsg38p 02-25-2013 02:59 PM

Re: Background application that listens on keypad.
 
Only the application that owns the currently focused UI component gets the keystrokes.

There is no global keystroke listener for the Java API's.

abhsax1978@hotmail.com 03-01-2013 11:13 PM

Re: Background application that listens on keypad.
 
Ok, it could be convenience key that is manually set by user as a shortcut to my application..
Or event thrown by accelerometer from a background service, which could activate my application..
Let me see this can happen.

abhsax1978@hotmail.com 03-01-2013 11:13 PM

Re: Background application that listens on keypad.
 
Accelerator is happening, but you have to shake hard!!. Otherwise I would need my application to be notified (it runs on autostart, so it is already running) when the hot (convenience) key is pressed.

I think of using another (secondary) application that notifies the main (backlight) application (and that secondary application starts on hotkey, notifies and closes), back light is switched on in an event. Then again this hot key is pressed, the main application is notified, to turn it off, and the secondary application closes.

There could be a direct way of doing it. I mean: do I need this secondary application?

abhsax1978@hotmail.com 03-12-2013 05:44 AM

Re: Background application that listens on keypad.
 
I have done the application and it is fabulous as stated above. Thanks.


All times are GMT -5. The time now is 11:39 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.