diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/os/input_event.cpp | 4 | ||||
-rw-r--r-- | core/os/input_event.h | 2 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 499ec0c08e..27c7c10aef 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -141,11 +141,11 @@ InputEvent::operator String() const { return ""; } -void InputEvent::set_as_action(const String& p_action) { +void InputEvent::set_as_action(const String& p_action, bool p_pressed) { type=ACTION; action.action=InputMap::get_singleton()->get_action_id(p_action); - action.pressed=false; + action.pressed=p_pressed; } bool InputEvent::is_pressed() const { diff --git a/core/os/input_event.h b/core/os/input_event.h index 2c10bffcd2..218ff327d1 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -288,7 +288,7 @@ struct InputEvent { bool is_pressed() const; bool is_action(const String& p_action) const; bool is_echo() const; - void set_as_action(const String& p_action); + void set_as_action(const String& p_action, bool p_pressed); bool operator==(const InputEvent &p_event) const; operator String() const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index bd731abeaf..28953a535f 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -684,6 +684,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_PTR0R( InputEvent, is_pressed ); VCALL_PTR1R( InputEvent, is_action ); VCALL_PTR0R( InputEvent, is_echo ); + //VCALL_PTR2( InputEvent, set_as_action ); struct ConstructData { @@ -1488,6 +1489,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_pressed,varray()); ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action,STRING,"action",varray()); ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_echo,varray()); + //ADDFUNC2(INPUT_EVENT,NIL,InputEvent,set_as_action,STRING,"action",BOOL,"pressed",varray()); /* REGISTER CONSTRUCTORS */ |