From e17a5333f336ebc585c6ec4c95ad9e5d1a9161b9 Mon Sep 17 00:00:00 2001 From: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com> Date: Wed, 24 Jul 2019 12:19:37 +0900 Subject: [PATCH] [NUI] Add KeyString in Key.cs (#936) * [NUI] Add KeyString in Key.cs - Provide to use 'KeyString' for a clearer meaning instead of 'KeyPressed' Change-Id: I5aa3680b81cc62d6718aa0f21a08bc7c74b8826b Signed-off-by: Seoyeon Kim * Update Key.cs - Add set property to KeyString. --- src/Tizen.NUI/src/internal/Interop/Interop.Key.cs | 9 +++++++ src/Tizen.NUI/src/public/Key.cs | 33 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Key.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Key.cs index 2f421c3..a80f7c9 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Key.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Key.cs @@ -58,6 +58,15 @@ namespace Tizen.NUI public static extern string Key_keyPressed_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyPressed_set")] + public static extern void Key_keyString_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyPressed_get")] + public static extern string Key_keyString_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Key_keyCode_set")] public static extern void Key_keyCode_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); diff --git a/src/Tizen.NUI/src/public/Key.cs b/src/Tizen.NUI/src/public/Key.cs index b7744b6..7a3e362 100755 --- a/src/Tizen.NUI/src/public/Key.cs +++ b/src/Tizen.NUI/src/public/Key.cs @@ -167,6 +167,24 @@ namespace Tizen.NUI } /// + /// Get the actual string returned that should be used for input editors. + /// + /// The key string + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string KeyString + { + get + { + return keyString; + } + set + { + keyString = value; + } + } + + /// /// Keycode for the key pressed. /// /// 3 @@ -288,6 +306,21 @@ namespace Tizen.NUI } } + private string keyString + { + set + { + Interop.Key.Key_keyString_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = Interop.Key.Key_keyString_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + private int keyCode { set -- 2.7.4