[NUI] Add to get LogicalKey and KeyPressed (#745)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Tue, 12 Mar 2019 03:47:55 +0000 (12:47 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 12 Mar 2019 03:47:55 +0000 (12:47 +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 5da559b..3a3bfec 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 de26fd4..0c64694 100755 (executable)
@@ -15,6 +15,8 @@
  *
  */
 
+using System.ComponentModel;
+
 namespace Tizen.NUI
 {
 
@@ -159,7 +161,28 @@ namespace Tizen.NUI
             }
         }
 
-        /* duplicated with KeyPressedName : removed
+        /// <summary>
+        /// Get the logical key string. (eg. shift + 1 == "exclamation")
+        /// </summary>
+        /// <returns>The logical key symbol</returns>
+        /// <since_tizen> 5 </since_tizen>
+        /// 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>
+        /// <since_tizen> 5 </since_tizen>
+        /// 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
@@ -167,7 +190,6 @@ namespace Tizen.NUI
                 return keyPressed;
             }
         }
-        */
 
         /// <summary>
         /// Keycode for the key pressed.
@@ -410,6 +432,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>
         /// Enumeration for specifying the state of the key event.
         /// </summary>
@@ -434,4 +466,4 @@ namespace Tizen.NUI
         }
 
     }
-}
\ No newline at end of file
+}