1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
8 int map_key_RND_to_SP(int key)
12 return (key & MV_UP ? keySpaceUp :
13 key & MV_LEFT ? keySpaceLeft :
14 key & MV_DOWN ? keySpaceDown :
15 key & MV_RIGHT ? keySpaceRight : keySpace);
19 return (key & MV_UP ? keyUp :
20 key & MV_LEFT ? keyLeft :
21 key & MV_DOWN ? keyDown :
22 key & MV_RIGHT ? keyRight : keyNone);
26 int map_key_SP_to_RND(int key)
28 return (key == keyUp ? MV_UP :
29 key == keyLeft ? MV_LEFT :
30 key == keyDown ? MV_DOWN :
31 key == keyRight ? MV_RIGHT :
32 key == keySpaceUp ? KEY_BUTTON | MV_UP :
33 key == keySpaceLeft ? KEY_BUTTON | MV_LEFT :
34 key == keySpaceDown ? KEY_BUTTON | MV_DOWN :
35 key == keySpaceRight ? KEY_BUTTON | MV_RIGHT :
36 key == keySpace ? KEY_BUTTON : MV_NONE);
39 void subProcessKeyboardInput(byte action)
41 DemoKeyCode = map_key_RND_to_SP(action);