deanbrowne / j4me

Automatically exported from code.google.com/p/j4me
1 stars 1 forks source link

arrow keys + enter not working on mpower emulator #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

arrays keys (int code : 37 to 40) and enter key (in code 10) are not
working using the mpowerplayer  emulator. (mpowerplayer.com)

I found a potential bug in DeviceScreen.translateKeyCode : 

        .....

        // Is it a normal key?
        //   BlackBerry devices give the trackwheel and trackball movements
        //   as values through 6 and getGameAction does not translate them.
        //   There are no ASCII values used below 8 (backspace) so this is
        //   fine.
        if ( key > 6 )
        {
            return key;
        }

if I remove this code, all is ok on the mpowerplayer emulator. 

According to the code's comment, It may be more accurate to write It 
                 if ( blackberry && key > 6 )
        {
            return key;
        }

not sure !

Original issue reported on code.google.com by jmherme...@gmail.com on 17 Mar 2008 at 3:57

GoogleCodeExporter commented 9 years ago
same issue here - except when using your code, it disables the keys KEY_NUM*. 
As a
temporary solution, I just use the getGameAction() function. :(

Original comment by viljami....@gmail.com on 7 May 2009 at 1:07