[NUI] Add to get LogicalKey and KeyPressed (#745) (#773)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 1 Apr 2019 03:52:49 +0000 (12:52 +0900)
committerGitHub <noreply@github.com>
Mon, 1 Apr 2019 03:52:49 +0000 (12:52 +0900)
* [NUI] Add to get LogicalKey and KeyPressed

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
* Update Key.cs

To use [EditorBrowsable(EditorBrowsableState.Never)] tag, Should include 'System.ComponentModel'.

src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/public/Key.cs

index 36cb84d..07fd974 100755 (executable)
@@ -4139,6 +4139,8 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_Key_state_get")]
         public static extern int Key_state_get(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_Key_logicalKey_get")]
+        public static extern string Key_logicalKey_get(global::System.Runtime.InteropServices.HandleRef jarg1);
 
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_new_LongPressGestureDetector__SWIG_0")]
         public static extern global::System.IntPtr new_LongPressGestureDetector__SWIG_0();
index b41a662..0823b68 100755 (executable)
@@ -15,6 +15,8 @@
  *
  */
 
+using System.ComponentModel;
+
 namespace Tizen.NUI
 {
 
@@ -136,7 +138,26 @@ namespace Tizen.NUI
             }
         }
 
-        /* duplicated with KeyPressedName : removed
+        /// <summary>
+        /// Get the logical key string. (eg. shift + 1 == "exclamation")
+        /// </summary>
+        /// <returns>The logical key symbol</returns>
+        /// 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 LogicalKey
+        {
+            get
+            {
+                return logicalKey;
+            }
+        }
+
+        /// <summary>
+        /// Get the actual string returned that should be used for input editors.
+        /// </summary>
+        /// <returns>The key string</returns>
+        /// 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 KeyPressed
         {
             get
@@ -144,7 +165,6 @@ namespace Tizen.NUI
                 return keyPressed;
             }
         }
-        */
 
         /// <summary>
         /// Keycode for the key pressed.
@@ -328,6 +348,16 @@ namespace Tizen.NUI
             }
         }
 
+        private string logicalKey
+        {
+            get
+            {
+                string ret = NDalicPINVOKE.Key_logicalKey_get(swigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
+        }
+
         /// <summary>
         /// Dispose.
         /// </summary>
@@ -434,4 +464,4 @@ namespace Tizen.NUI
             disposed = true;
         }
     }
-}
\ No newline at end of file
+}