Re: [Hecl-devel] Hecl running on BB!
Brought to you by:
davidw
From: Martin M. <DO...@gm...> - 2009-09-12 08:10:32
|
Hi David, > That was a good idea. It definitely looks better. The problem is that > it doesn't seem to run quite right:-/ It lets me move between the > buttons on the main screen, but clicking on them doesn't seem to do > much. I wonder if it's a difference in events of some kind? It's likely the key-code mapping but i have had a look in BlackBerry JDE API Reference 4.5.0/4.7.0 and found out that the FIRE code is 8 for both api's. It's the same like in the wtk emulator :(. So I've now idea what is going wrong. It's a bit hard to fix it or just to understand it for me, because i don't have an bb phone and don't have even the emulator running. However, I'm happy the its run at least :). Maybe you should put some system.outs in to the code and see what the MwtManager receives? MwtManager.java // notify input protected void keyPressed(int keyCode) { System.out.println(keyCode); try { if (keyCode > 0) { event.keyPressed(keyCode); } else { event.keyPressed(getGameAction(keyCode)); } } catch (HeclException ex) { ex.printStackTrace(); } } MwtManagerCmd.java public void keyPressed(int keyCode) throws HeclException { System.out.println(keyCode); ip.eval(new Thing("keypressed " + keyCode)); } and into the script it self. proc keypressed {keycode} { global htm puts "$keycode" [$htm getmain] setkeystate $keycode "keystate_pressed" "true" } Here is the method call sequence: The MwtManager imtements the EventListener. Means the "keyPressed" method will call first. This method translate the keycode by "getGameAction" when it's <0. In the emulator it's <0. (Maybe it's not negative for bb-emu???) The event interface is implemented by MwtManagerCmd.java and here the hecl command "keypressed" will be called. This is the place where i usually set the keystate to the window object. Sometimes we can make an low-level event handling here. So, I hope it's help a little so far. When you have the bb-emu output post it to the list. And I'll try to fix them. Thanks in advance! Martin -- Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02 |