src/Input.hh
changeset 233 ff4ecea83cf5
parent 230 78cf0cd69af4
child 235 0a0c729365ee
equal deleted inserted replaced
232:59f014d22a38 233:ff4ecea83cf5
     5 #include <ClanLib/Display/input_device.h>
     5 #include <ClanLib/Display/input_device.h>
     6 #include <ClanLib/Display/keys.h>
     6 #include <ClanLib/Display/keys.h>
     7 
     7 
     8 // const uint16_t INPUT_INTERVAL_MS = 20;
     8 // const uint16_t INPUT_INTERVAL_MS = 20;
     9 
     9 
    10 enum _PlayerInput {
    10 enum PlayerInputBit {
       
    11     INPUT_NONE          = 0x0000,
       
    12 
    11     INPUT_AIM_UP        = 0x0001,
    13     INPUT_AIM_UP        = 0x0001,
    12     INPUT_AIM_DOWN      = 0x0002,
    14     INPUT_AIM_DOWN      = 0x0002,
    13 
    15 
    14     INPUT_MOVE_LEFT     = 0x0004,
    16     INPUT_MOVE_LEFT     = 0x0004,
    15     INPUT_MOVE_RIGHT    = 0x0008,
    17     INPUT_MOVE_RIGHT    = 0x0008,
    22     INPUT_UNROPE        = 0x0200,
    24     INPUT_UNROPE        = 0x0200,
    23     INPUT_ROPE_UP       = 0x0400,
    25     INPUT_ROPE_UP       = 0x0400,
    24     INPUT_ROPE_DOWN     = 0x0800,
    26     INPUT_ROPE_DOWN     = 0x0800,
    25 };
    27 };
    26 
    28 
    27 typedef uint16_t PlayerInput;
    29 enum GuiInputBit {
    28 
    30     GUI_INPUT_QUIT              = 0x0001,
    29 struct InputKeymapEntry {
    31     GUI_INPUT_DISPLAY_WEAPON    = 0x0002,
    30     int keycode1, keycode2;
    32     GUI_INPUT_DEBUG_PLAYER      = 0x0004,
    31     enum _PlayerInput input;
       
    32 };
    33 };
    33 
    34 
    34 /*
    35 typedef uint16_t PlayerInput;
    35  * Get the global input keymap
    36 typedef uint16_t GuiInput;
    36  */
       
    37 InputKeymapEntry* getGlobalInputKeymap (void);
       
    38 
    37 
    39 /*
    38 /*
    40  * Handle keycodes
    39  * Handle keycodes
    41  */
    40  */
    42 PlayerInput handleInputDevice (CL_InputDevice &keyboard);
    41 PlayerInput handlePlayerInput (CL_InputDevice &keyboard);
       
    42 GuiInput handleGuiInput (CL_InputDevice &keyboard);
    43 
    43 
    44 #endif
    44 #endif