mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add methods to check which event first triggered "just pressed/released" state.
This commit is contained in:
parent
ca452113d4
commit
10fd7163d4
7 changed files with 114 additions and 17 deletions
|
|
@ -109,6 +109,8 @@ private:
|
|||
uint64_t pressed_process_frame = UINT64_MAX;
|
||||
uint64_t released_physics_frame = UINT64_MAX;
|
||||
uint64_t released_process_frame = UINT64_MAX;
|
||||
ObjectID pressed_event_id;
|
||||
ObjectID released_event_id;
|
||||
bool exact = true;
|
||||
|
||||
struct DeviceState {
|
||||
|
|
@ -306,6 +308,8 @@ public:
|
|||
bool is_action_pressed(const StringName &p_action, bool p_exact = false) const;
|
||||
bool is_action_just_pressed(const StringName &p_action, bool p_exact = false) const;
|
||||
bool is_action_just_released(const StringName &p_action, bool p_exact = false) const;
|
||||
bool is_action_just_pressed_by_event(const StringName &p_action, const Ref<InputEvent> &p_event, bool p_exact = false) const;
|
||||
bool is_action_just_released_by_event(const StringName &p_action, const Ref<InputEvent> &p_event, bool p_exact = false) const;
|
||||
float get_action_strength(const StringName &p_action, bool p_exact = false) const;
|
||||
float get_action_raw_strength(const StringName &p_action, bool p_exact = false) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue