diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/input_map.cpp | 18 | ||||
-rw-r--r-- | core/input_map.h | 3 | ||||
-rw-r--r-- | core/register_core_types.cpp | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/core/input_map.cpp b/core/input_map.cpp index 296b39350a..9426b0568e 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -31,6 +31,24 @@ InputMap *InputMap::singleton=NULL; +void InputMap::_bind_methods() { + + ObjectTypeDB::bind_method(_MD("has_action","action"),&InputMap::has_action); + ObjectTypeDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); + ObjectTypeDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); + ObjectTypeDB::bind_method(_MD("add_action","action"),&InputMap::add_action); + ObjectTypeDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); + + ObjectTypeDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); + ObjectTypeDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); + ObjectTypeDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); + ObjectTypeDB::bind_method(_MD("get_action_list","action"),&InputMap::get_action_list); + ObjectTypeDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); + ObjectTypeDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); + +} + + void InputMap::add_action(const StringName& p_action) { ERR_FAIL_COND( input_map.has(p_action) ); diff --git a/core/input_map.h b/core/input_map.h index 3a56892585..bf20645b15 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -46,6 +46,9 @@ class InputMap : public Object { List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const; +protected: + + static void _bind_methods(); public: static _FORCE_INLINE_ InputMap *get_singleton() { return singleton; } diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 7e7ce3479f..169711b680 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -193,6 +193,7 @@ void register_core_singletons() { Globals::get_singleton()->add_singleton( Globals::Singleton("TranslationServer",TranslationServer::get_singleton() ) ); Globals::get_singleton()->add_singleton( Globals::Singleton("TS",TranslationServer::get_singleton() ) ); Globals::get_singleton()->add_singleton( Globals::Singleton("Input",Input::get_singleton() ) ); + Globals::get_singleton()->add_singleton( Globals::Singleton("InputMap",InputMap::get_singleton() ) ); } |