-Modified Input and added is_action_just_pressed() as well as is_action_just_released()

This commit is contained in:
Juan Linietsky
2016-09-01 18:58:52 -03:00
parent 3759d378da
commit 5b96c3a552
11 changed files with 196 additions and 41 deletions

View File

@ -35,12 +35,14 @@
class InputMap : public Object {
OBJ_TYPE( InputMap, Object );
static InputMap *singleton;
public:
struct Action {
int id;
List<InputEvent> inputs;
};
private:
static InputMap *singleton;
mutable Map<StringName, Action> input_map;
mutable Map<int,StringName> input_id_map;
@ -72,7 +74,7 @@ public:
bool event_is_action(const InputEvent& p_event, const StringName& p_action) const;
bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const;
const Map<StringName, Action>& get_action_map() const;
void load_from_globals();
void load_default();