summaryrefslogtreecommitdiffstats
path: root/core/os/input_event.cpp
diff options
context:
space:
mode:
authorJaguar <killerjaguar26@gmail.com>2015-06-23 16:24:48 -0400
committerJaguar <killerjaguar26@gmail.com>2015-06-23 16:24:48 -0400
commite6fb0cf970639d70d8207bf888eaf02681ac159a (patch)
treef0d4713e78e6813217fbb4cc47fbe1558845c10f /core/os/input_event.cpp
parente42aed6ed059b23c100f5a0bc5170831f12400aa (diff)
downloadredot-engine-e6fb0cf970639d70d8207bf888eaf02681ac159a.tar.gz
Added helper methods to InputEvent
Diffstat (limited to 'core/os/input_event.cpp')
-rw-r--r--core/os/input_event.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index fc23012281..2bd62927b0 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -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;