1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

Added helper methods to InputEvent

This commit is contained in:
Jaguar
2015-06-23 16:24:48 -04:00
parent e42aed6ed0
commit e6fb0cf970
3 changed files with 16 additions and 0 deletions

View File

@@ -173,6 +173,16 @@ bool InputEvent::is_action(const String& p_action) const {
return InputMap::get_singleton()->event_is_action(*this,p_action);
}
bool InputEvent::is_action_pressed(const String& p_action) const {
return is_action(p_action) && is_pressed() && !is_echo();
}
bool InputEvent::is_action_released(const String& p_action) const {
return is_action(p_action) && !is_pressed();
}
uint32_t InputEventKey::get_scancode_with_modifiers() const {
uint32_t sc=scancode;