22 #ifndef NUVIE_KEYBINDING_KEYS_H 23 #define NUVIE_KEYBINDING_KEYS_H 25 #include "ultima/nuvie/keybinding/keys_enum.h" 26 #include "ultima/nuvie/core/nuvie_defs.h" 27 #include "ultima/shared/std/containers.h" 28 #include "ultima/shared/std/string.h" 29 #include "common/events.h" 30 #include "common/hash-str.h" 36 AXES_PAIR1, AXES_PAIR2, AXES_PAIR3, AXES_PAIR4, UNHANDLED_AXES_PAIR
40 kAltCodeModeBegin = 0,
65 ParseActionMap _actions;
66 ParseHashedActionMap _actionsHashed;
67 int16 _joyAxisPositions[8];
69 bool repeat_hat, joy_repeat_enabled;
70 uint32 next_axes_pair_update, next_axes_pair2_update, next_axes_pair3_update,
71 next_axes_pair4_update, next_joy_repeat_time;
72 uint16 pair1_delay, pair2_delay, pair3_delay, pair4_delay, joy_repeat_delay;
73 uint8 x_axis, y_axis, x_axis2, y_axis2, x_axis3, y_axis3, x_axis4, y_axis4;
74 sint8 enable_joystick;
76 void LoadFromFileInternal(
const char *filename);
81 void AddKeyBinding(Common::KeyCode sym, byte mod,
const Action *action,
82 int nparams,
int param);
98 void LoadFromFile(
const char *filename);
99 void LoadGameSpecificKeys();
100 void LoadFromPatch();
101 void handle_wrong_key_pressed();
102 bool handle_always_available_keys(
ActionType a);
104 void ShowKeys()
const;
105 void AddIosBindings();
107 uint8 get_axis(uint8 index)
const;
108 void set_axis(uint8 index, uint8 value);
109 Common::KeyCode get_key_from_joy_walk_axes() {
110 return get_key_from_joy_axis_motion(x_axis,
true);
112 Common::KeyCode get_key_from_joy_axis_motion(
int axis,
bool repeating);
113 Common::KeyCode get_key_from_joy_hat_button(uint8 hat_button)
const;
114 Common::KeyCode get_key_from_joy_events(
Common::Event *event);
115 void init_joystick(sint8 joy_num);
117 uint32 get_next_joy_repeat_time()
const {
118 return next_joy_repeat_time;
120 void set_enable_joy_repeat(
bool val) {
121 if (joy_repeat_delay == 10000)
return;
122 joy_repeat_enabled = val;
124 bool is_joy_repeat_enabled()
const {
125 return joy_repeat_enabled;
127 bool is_hat_repeating()
const {
130 void set_hat_repeating(
bool val) {
133 sint8 get_enable_joystick()
const {
134 return enable_joystick;
136 void set_enable_joystick(
bool val) {
137 enable_joystick = val;
141 void ParseText(
char *text,
int len);
142 void ParseLine(
const char *line);
143 void FillParseMaps();
145 joy_axes_pairs get_axes_pair(
int axis)
const;
146 Common::KeyCode get_key_from_joy_button(uint8 button);
void clear(bool shrinkArray=0)
Definition: hashmap.h:427
Definition: configuration.h:61
Definition: detection.h:27
Definition: keyboard.h:294