Listener of the Volume buttons and switch off & on

I want to do tha background applications and I would add the listener for the Volume buttons and light switch off & on. Please help me how I can do this.

Thanks in advance.

Thanks peter & simon. Its has helped for the my requirement.

public MyApp() {}
Push a screen onto the stack in the user interface for rendering.
pushScreen (new MyScreen());
addKeyListener (new ShortcutHandler());
}

private class ShortcutHandler implements KeyListener {

{} public boolean keyChar (key char, int status, int time)
Returns false;
}

{} public boolean keyDown (keycode, int, int times)
If (Keypad.KEY_VOLUME_DOWN is {Keypad.key (keycode))}
Returns true;
{} Else if (Keypad.KEY_VOLUME_UP == {Keypad.key (keycode))}
Returns true;
{} Else if (Keypad.KEY_LOCK == {Keypad.key (keycode))}
Returns true;
}
Let the system to pass the event to another auditor.
Returns false;
}

{public boolean keyRepeat (keycode int, int times)
Returns false;
}

{public boolean keyStatus (keycode int, int times)
Returns false;
}

{} public boolean keyUp (keycode int, int times)
Returns false;
}

}

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • Recommendation of the battery for Satellite C660

    Can anyone recommend a spare battery?My only now realize only a paltry 16 minutes:) Preference value for the money farm. I saw one of those listed on Amazon, a Lenoge for a little over £10. Has anyone tried this before?Thanks a lot for your help.

  • Sattalite Pro 6100: Very slow Windows Installation

    I have a series of Sattalite Pro 6100.The hard drive crashed, so I bought a new. It is 40 GB / 5700 rpm, so supposed to be slightly faster than the original equipment.When I placed it, BIOS did not.I removed it, put it back and BIOS saw him.I placed

  • Satellite L500 LCD replacement screen (PSLJ0A - 01 K 013)

    Hello I need to replace the LCD for my Satellite L500 PSLJ0A - 01 K 013, but I have trouble finding a LCD 15.6 "appropriate. I am trying to find online, but it seems that the Web sites that sell screens LCD do not have my laptop model. It will be the

  • USB ports not working on DV6149US

    I have a DV6149US which is under Widows XP SP3 and was fine, but suddenly my 4 USB ports no longer work, even for the memory card port When I connect a device or a memory card, I have the typical noise that the device is recognized but it never appea

  • Satellite A100-409 restarts a lot due to BSOD

    I have a Toshiba A100-409, before I had the M70 - 163, the great laptop, incidentally, but 409 restarts a lot. If the 409 go in mode sleep and whenever I start it again, I get a blue screen with the error.Sometimes the 409 is the same and when it is