| version 1.1, 2005/02/07 16:56:32 | version 1.2, 2005/02/26 03:59:50 | 
| Line 23 | Line 23 | 
 |  |  | 
 | #include        "keystat.h" | #include        "keystat.h" | 
 | #include        "fddfile.h" | #include        "fddfile.h" | 
| #include        "palm5way.h" | #include        "PalmNavigator.h" | 
 | #include        "joymng.h" | #include        "joymng.h" | 
 | #include        "statsave.h" | #include        "statsave.h" | 
 |  |  | 
| Line 278  void HandleMenuChoice(UINT wParam) { | Line 278  void HandleMenuChoice(UINT wParam) { | 
 |  |  | 
 | static int ApplicationHandleEvent(EventPtr eventP) { | static int ApplicationHandleEvent(EventPtr eventP) { | 
 |  |  | 
| int handled = 0; | int         handled = 0; | 
| UINT32*   idp = (UINT32*)eventP; | UINT32* idp = (UINT32*)eventP; | 
 | UINT16  topdata = ByteSwap16(*(idp+2) & 0xffff); | UINT16  topdata = ByteSwap16(*(idp+2) & 0xffff); | 
 | UINT    keycode; | UINT    keycode; | 
 |  | UINT32  keystate, rockerstate, updownstate, navstate; | 
 |  |  | 
 |  | keystate = ARM_KeyCurrentState(); | 
 |  | rockerstate = (keystate & 0x001f0000) >> 16; | 
 |  | updownstate = (keystate & (keyBitPageUp | keyBitPageDown)) >> 1; | 
 |  | navstate = (keystate & keyBitNavLRS) >> 22; | 
 |  | joymng_5way(rockerstate | updownstate | navstate); | 
 |  | joymng_hardkey(keystate); | 
 |  |  | 
 |  |  | 
 | switch (ByteSwap16(eventP->eType)) { | switch (ByteSwap16(eventP->eType)) { | 
 | case keyDownEvent: | case keyDownEvent: | 
 | if (inmenu) break; | if (inmenu) break; | 
| if ((topdata == vchrNavChange) || (topdata == vchrPageUp) || (topdata == vchrPageDown)) { | switch (topdata) { | 
| UINT16 chrcode = ByteSwap32(*(idp+2)) & 0xffff; | case vchrNavChange: | 
| if (joymng_5way(chrcode) == FALSE) { | case vchrPageUp: | 
| break; | case vchrPageDown: | 
| } | case vchrRockerLeft: | 
| handled = 1; | case vchrRockerRight: | 
| } | case vchrHard1: | 
| else if ((topdata == vchrHard1) || (topdata == vchrHard2) || (topdata == vchrHard3) || (topdata == vchrHard4)) { | case vchrHard2: | 
| switch (topdata) { | case vchrHard3: | 
| case vchrHard1: | case vchrHard4: | 
| keycode = xmiloscfg.HARDKEY1; | handled = 1; | 
| break; |  | 
| case vchrHard2: |  | 
| keycode = xmiloscfg.HARDKEY2; |  | 
| break; |  | 
| case vchrHard3: |  | 
| keycode = xmiloscfg.HARDKEY3; |  | 
| break; |  | 
| case vchrHard4: |  | 
| keycode = xmiloscfg.HARDKEY4; |  | 
| break; |  | 
| default: |  | 
| keycode = -1; |  | 
| break; |  | 
| } |  | 
| if (keycode == 0) { |  | 
| joymng_btnsync(JOY_BTN1_BIT); |  | 
| } |  | 
| else if (keycode == 1) { |  | 
| joymng_btnsync(JOY_BTN2_BIT); |  | 
| } |  | 
| else if (keycode < 12) { |  | 
| palmkbd_keydown(hardkey[keycode] , TRUE); |  | 
| } |  | 
| else { |  | 
 | break; | break; | 
| } | default: | 
| handled = 1; | if (!(topdata & 0xff00)) { | 
| } | keycode =  topdata & 0x7f; | 
| else if (!(topdata & 0xff00)) { | palmkbd_keydown(keycode, TRUE); | 
| keycode =  topdata & 0x7f; | handled = 1; | 
| palmkbd_keydown(keycode, TRUE); | } | 
| handled = 1; |  | 
 | } | } | 
 | break; | break; | 
 | case keyUpEvent: | case keyUpEvent: |