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

Recommended Answers

All 4 Replies

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.

on java platform - with java me

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.