02-25-2013 05:18 AM - edited 02-25-2013 05:19 AM
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.
Solved! Go to Solution.
02-25-2013 07:15 AM
Welcome to the forums.
If you search the forum you will find that other people have asked similar question. The key listener API is designed to work when the active application is in the foreground. In other words, if your application does not have the screen, then you won't be able to intercept the keyboard events like someone pressing "A" 3 times.
Search for more information.
I thought the backlight came on when you pressed a key anyway?
02-26-2013 07:05 AM
Sorry for the mistake.. The key input would be a short cut to my application. This invokes my application and from there the flash light turns on. This may happen like toggle. Like torch which goes off on another switch hit.
If this is accomplished, more things can be done.
02-26-2013 07:09 AM
02-27-2013 07:58 AM
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.
I shall be reporting this is success or not..
02-27-2013 08:06 AM
03-02-2013 12:12 AM
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?