From e6fb0cf970639d70d8207bf888eaf02681ac159a Mon Sep 17 00:00:00 2001
From: Jaguar <killerjaguar26@gmail.com>
Date: Tue, 23 Jun 2015 16:24:48 -0400
Subject: Added helper methods to InputEvent

---
 core/os/input_event.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'core/os/input_event.cpp')

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;
-- 
cgit v1.2.3