tags:

views:

31

answers:

2

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 can any body help me thanks

A: 

On what platform? What kind of keyboard? This is an implementation-specific question; there's no standardized keycode for a volume key as it's not part of the standard 101- or 104-key layouts. (And even then, keycodes vary between countries and languages.)

Jonathan Grynspan
on java platform - i read sony ericsson Developers guidlines there is -36 and -37 for volume keys but it`s not work on emulator and phone
mahdi
Windows? Mac? Linux? Or are you targetting that phone series specifically?
Jonathan Grynspan
on java based mobile phones like nokia , sony ericsson and ...
mahdi
Which gets back to my original point: this is an implementation detail and unless it's defined in the J2ME spec (I don't believe it is) then the answer to your question is going to vary from model to model. Nokia phones are going to implement this differently from Sony phones, if they implement it at all.
Jonathan Grynspan
A: 

It's very, very rare that mobile phones allow MIDlets to get access to such buttons as volume and camera.

If your mobile phone supports this, it should call function keyPressed(int keyCode) of Canvas. If you somehow output the code, you will be able to use it.

I'll say once again that it's very rare, and if some mobile phone supports the keys, others won't.

BlaXpirit