In the MainScreen or FullScreen class, override the following method:
protected boolean keyControl(char key, int status, int time) { switch (key) { case Characters.CONTROL_VOLUME_UP:
The caveat is that this only works when your application and this screen are in the foreground. If you want to allow users to use the volume keys when your application is in the background, you need to use the BlackBerry Media Actions API , which is available only in version 5.0 and higher.
source share