08-26-2009 01:25 PM
Hi,
To start i would like to say that my java skills are not all that good and put the blackberry JDK into the mix and that skill has gone down a little, this is really the first time i've given it a go.
I've found an open source application that i like, but the problem i have with it is when i install it to my Strom (9500) i runs well but when i have to use the numeric pad for controls it doesn't seem to pick them up.
the app is a Gameboy emulator that has been built to be cross platform and it does work on most phones that i've used. So because of cross platform the conrols code is not specific to any device, which i guess is why the storm doesn't work with it. I was wondering if someone could point me to the right direction, maybe some good tutorials that would allow me to make a convertion, or even start something in this thread where i we can tried different things.
this is the code i found for hte controls:
public void keyReleased(int keyCode) { for (int i = 0; i < 8; i++) { if (keyCode == key[i]) { cpu.buttonUp(i); } } }//end Keyreleased
public void keyPressed(int keyCode) { if (settingKeys) { key[keySetCounter++] = keyCode; if (keySetCounter == 8) { writeSettings(); settingKeys = false; } repaint(); return; } for (int i = 0; i < 8; i++) { if (keyCode == key[i]) { cpu.buttonDown(i); } } }//End KeyPressed
i've only just installed all the JDK's amd plugins needed for blackberry development on using eclipse so its all up ti date and so is the firmware for my storm.
Any pointers would be awesome, if you need more information please let me know.
Thanks Brian.
08-26-2009 01:44 PM
From what code you posted it looks good to me. Have you tried setting a breakpoint inside the keyPressed/keyReleased functions and seeing if they are called when you press a numeric key?
Wait, scratch that. I just remebered that you are trying this with the Storm, take a look at net.rim.device.api.lcdui.BlackBerryCanvas (or net.rim.device.api.lcdui.game.BlackBerryGameCanvas
Hope that helps.