summaryrefslogtreecommitdiff
path: root/core/os/input_event.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov <maxmight@gmail.com>2015-06-26 21:35:47 +0300
committerKostadin Damyanov <maxmight@gmail.com>2015-06-26 21:35:47 +0300
commite0e54ea7d456c0fabd8f3f9b2667a69ff520f852 (patch)
tree9ce4e0b6db40ac2ab07b8582e57282fe63130165 /core/os/input_event.cpp
parentf61eb5fd8e13642c82364f8ee66a0f6c791a4511 (diff)
parenta67486a39ee629acac068a6d014015944cf83bb3 (diff)
Merge remote-tracking branch 'upstream/master'
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;