From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai <chaifix@163.com> Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Input/OnScreenKeyboard.h | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Runtime/Input/OnScreenKeyboard.h (limited to 'Runtime/Input/OnScreenKeyboard.h') diff --git a/Runtime/Input/OnScreenKeyboard.h b/Runtime/Input/OnScreenKeyboard.h new file mode 100644 index 0000000..a828173 --- /dev/null +++ b/Runtime/Input/OnScreenKeyboard.h @@ -0,0 +1,47 @@ +#ifndef UNITY_ONSCREEN_KEYBOARD_ +#define UNITY_ONSCREEN_KEYBOARD_ + +#include "Runtime/Math/Color.h" +#include "Runtime/Math/Rect.h" +#include "Runtime/Graphics/ScreenManager.h" + +class KeyboardOnScreen +{ +public: + + static Rectf GetRect(); + static bool IsVisible(); + + static void Hide(); + static void setInputHidden(bool flag); + static bool isInputHidden(); + +public: + KeyboardOnScreen(std::string const& text, UInt32 keyboardType = 0, + bool autocorrection = true, bool multiline = false, + bool secure = false, bool alert = false, + std::string const& textPlaceholder = ""); + ~KeyboardOnScreen(); + bool isActive() const; + bool isDone() const; + bool wasCanceled() const; + std::string getText() const; + void setText(std::string text); + void setActive(bool flag = true); + +private: + #if UNITY_WP8 + static BridgeInterface::IWP8Keyboard^ ms_Keyboard; + BridgeInterface::IWP8Keyboard^ m_Keyboard; + #endif + ColorRGBA32 textColor; + ColorRGBA32 backgroundColor; + UInt32 keyboardType; + std::string textPlaceholder; + bool autocorrection; + bool multiline; + bool secure; + bool alert; +}; + +#endif -- cgit v1.1-26-g67d0