parent
f5477ee36f
commit
b54910eb05
@ -749,6 +749,15 @@ bool InputEventJoypadButton::action_match(const Ref<InputEvent> &p_event, bool *
|
|||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InputEventJoypadButton::shortcut_match(const Ref<InputEvent> &p_event) const {
|
||||||
|
|
||||||
|
Ref<InputEventJoypadButton> button = p_event;
|
||||||
|
if (button.is_null())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return button_index == button->button_index;
|
||||||
|
}
|
||||||
|
|
||||||
String InputEventJoypadButton::as_text() const {
|
String InputEventJoypadButton::as_text() const {
|
||||||
|
|
||||||
return "InputEventJoypadButton : button_index=" + itos(button_index) + ", pressed=" + (pressed ? "true" : "false") + ", pressure=" + String(Variant(pressure));
|
return "InputEventJoypadButton : button_index=" + itos(button_index) + ", pressed=" + (pressed ? "true" : "false") + ", pressure=" + String(Variant(pressure));
|
||||||
@ -950,11 +959,10 @@ bool InputEventAction::is_pressed() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool InputEventAction::shortcut_match(const Ref<InputEvent> &p_event) const {
|
bool InputEventAction::shortcut_match(const Ref<InputEvent> &p_event) const {
|
||||||
Ref<InputEventKey> event = p_event;
|
if (p_event.is_null())
|
||||||
if (event.is_null())
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return event->is_action(action);
|
return p_event->is_action(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputEventAction::is_action(const StringName &p_action) const {
|
bool InputEventAction::is_action(const StringName &p_action) const {
|
||||||
|
@ -400,6 +400,7 @@ public:
|
|||||||
float get_pressure() const;
|
float get_pressure() const;
|
||||||
|
|
||||||
virtual bool action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const;
|
virtual bool action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const;
|
||||||
|
virtual bool shortcut_match(const Ref<InputEvent> &p_event) const;
|
||||||
|
|
||||||
virtual bool is_action_type() const { return true; }
|
virtual bool is_action_type() const { return true; }
|
||||||
virtual String as_text() const;
|
virtual String as_text() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user