summaryrefslogtreecommitdiff
path: root/core/os/input_event.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2015-06-28 22:28:02 +0900
committervolzhs <volzhs@gmail.com>2015-06-28 22:28:02 +0900
commit584dd4db878d0a9ebf44dc529dad35bf8dd4796b (patch)
treec601222ba20cacc80fba7ff43b5de425db13519c /core/os/input_event.cpp
parent81a1f32f0c1e4f64bb102c6aa46bcbb4e18bcd55 (diff)
parent2b64f73b0459190d20b2f6de39275ee7979317c4 (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
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;