From 8c4dd8de3919b789eac1a0f030563008bdcd44f5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 4 Jan 2015 21:16:40 -0300 Subject: [PATCH] -WIP to add proper key swapping according to keyboard layout -fix with non working removal of collision exception in 3D physics --- core/os/keyboard.cpp | 5 +++++ core/os/keyboard.h | 1 + core/os/os.cpp | 5 +++++ core/os/os.h | 13 +++++++++++++ servers/physics/physics_server_sw.cpp | 2 +- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index a4201c34eaa..c9979d19214 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -353,3 +353,8 @@ int find_keycode(const String& p_code) { return 0; } + +int latin_keyboard_keycode_convert(int p_keycode){ + + return p_keycode; +} diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 18b56b58303..b4ec5da26fb 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -328,5 +328,6 @@ enum KeyModifierMask { String keycode_get_string(uint32_t p_code); bool keycode_has_unicode(uint32_t p_unicode); int find_keycode(const String& p_code); +int latin_keyboard_keycode_convert(int p_keycode); #endif diff --git a/core/os/os.cpp b/core/os/os.cpp index 081f7c1c5ea..5e0e5eed77c 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -485,6 +485,11 @@ void OS::set_time_scale(float p_scale) { _time_scale=p_scale; } +OS::LatinKeyboardVariant OS::get_latin_keyboard_variant() const { + + return LATIN_KEYBOARD_QWERTY; +} + float OS::get_time_scale() const { return _time_scale; diff --git a/core/os/os.h b/core/os/os.h index 805d6ac57da..d4deff2f5e7 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -34,6 +34,7 @@ #include "vector.h" #include "os/main_loop.h" #include + /** @author Juan Linietsky */ @@ -348,6 +349,18 @@ public: virtual Error dialog_input_text(String p_title, String p_description, String p_partial, Object* p_obj, String p_callback); + enum LatinKeyboardVariant { + LATIN_KEYBOARD_QWERTY, + LATIN_KEYBOARD_QWERTZ, + LATIN_KEYBOARD_AZERTY, + LATIN_KEYBOARD_QZERTY, + LATIN_KEYBOARD_DVORAK, + LATIN_KEYBOARD_NEO, + }; + + + virtual LatinKeyboardVariant get_latin_keyboard_variant() const; + void set_time_scale(float p_scale); float get_time_scale() const; diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 510a6ea93f9..cfe5a73ce1f 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -770,7 +770,7 @@ void PhysicsServerSW::body_remove_collision_exception(RID p_body, RID p_body_b) BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); - body->remove_exception(p_body); + body->remove_exception(p_body_b); };