0

Hi
how can i use volume keys and camera key in app ?
i use -36 and - 37 constant value but it`s not work !!!
i use this to get key name

str = getKeyName(keyCode);

but when i press volume keys or camera key it`s return null
i want to use this key`s to scrolling text on touch screen phone`s
can any body help me
thanks

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by mahdi68
0

EDIT:

Sorry - this is assuming you are talking about the android platform which it seems you may be with those method names and specific buttons in question. Really though - it would really help to know what platform or api level you are on.


if you look at your onKey(Up/Down/LongPress) event there is a KeyEvent event parameter.

Look at the event - or simply call the KeyEvent class.

there is:

KeyEvent.KEYCODE_VOLUME_DOWN
KeyEvent.KEYCODE_VOLUME_UP
KeyEvent.KEYCODE_CAMERA

you will probably need to override the up and down events for these keys anywhere in your application where an activity needs to override them.

Edited by Killer_Typo: n/a

0

is this on the android platform or windows me platform or...?

the java platform (or runtime environment) itself is not enough information to go on. Normally you would want to setup a test loop and press the key in question, trying to capture whatever code was passed as part of the key event.

0

i develop this application for java basee mobile phones like nokia s40 or sony ericsson and ...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.