BlackBerry® smartphones based on Java® technology with BlackBerry® Device Software 4.3 and later
When a BlackBerry smartphone user presses the Volume keys, only the current application will process a volume change; the volume settings are not global across BlackBerry smartphone applications, including third-party applications. For example, if a BlackBerry smartphone user increases the volume in the Phone application, the volume in the Media application will not change unless the Volume keys are pressed while the Media application is in the foreground. This fine level of control allows for maximum flexibility but puts the responsibility on the implementing application to process Volume key actions.
Prior to BlackBerry Device Software 4.3, only applications built using the BlackBerry smartphone user interface (UI) APIs could capture events triggered by the Volume keys. This limitation was due to the Mobile Information Device Profile (MIDP) specification not defining a constant that could be mapped to the Volume keys. However, MIDP does allow the implementing BlackBerry smartphone application to define negative (i.e. less than 0) constant values while still adhering to the specification. Leveraging this flexibility, on a BlackBerry smartphone with BlackBerry Device Software 4.3 or later, a MIDP application may override the Canvas.keyPressed(int keyCode)method to detect a Volume key event. The values that map to the Volume keys are listed in the following table: