1 Replies - 1941 Views - Last Post: 07 July 2011 - 02:58 AM

#1 Mercurial  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 178
  • Joined: 06-November 09

j2me keylistener

Posted 16 June 2011 - 03:49 AM

Okay so, I'm using a DefaultFxTouchPhone1 and my game canvas seems to detect only if up,down,left,right keys are pressed. Should I be able to use any more keys?

int key= getKeyStates();
if ((key & UP_PRESSED) != 0) {
// code

My intellisense shows more options like GAME_A_PRESSED, GAME_B_PRESSED, GAME_C_PRESSED, GAME_D_PRESSED and FIRE_PRESSED. Should I be able to test those keys in the NetBeans emulator? Or do I have to run it on the actual phone (which I don't have atm.) ?

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: j2me keylistener

#2 itengineer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 23-April 09

Re: j2me keylistener

Posted 07 July 2011 - 02:58 AM


You can go for testing that on the emulator but do take care that emulator should be of same version as device especially in case of midp phones as the keycodes may vary.

You can detect all the keys if you use keycodes and the alternative methods. You may implement keyChar or keyDown. I 'll prefer keyDown as it has keycode.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1