Binding KeyboardGrab and KeyboardUnGrab
authorjoogab.yun <joogab.yun@samsung.com>
Fri, 25 Aug 2023 04:50:49 +0000 (13:50 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 29 Aug 2023 09:52:04 +0000 (18:52 +0900)
KeyboardGrab : Request grab key events according to the requested device subtype.
KeyboardUnGrab : Request ungrab key events

https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/297828/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/297829/

src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window/Window.cs

index 3b3714f..558e41f 100755 (executable)
@@ -379,6 +379,14 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_CursorVisibleSet")]
             public static extern void CursorVisibleSet(global::System.Runtime.InteropServices.HandleRef window, bool visible);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_KeyboardGrab")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool KeyboardGrab(global::System.Runtime.InteropServices.HandleRef window, uint deviceSubclass);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_KeyboardUnGrab")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool KeyboardUnGrab(global::System.Runtime.InteropServices.HandleRef window);
         }
     }
 }
index 3a60ec5..3956b86 100755 (executable)
@@ -1891,6 +1891,31 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Requests grab key events according to the requested device subtype
+        /// </summary>
+        /// <param name="deviceSubclass">The deviceSubclass type.</param>
+        /// <returns>True if KeyboardGrab succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool KeyboardGrab(DeviceSubClassType deviceSubclass)
+        {
+            bool ret = Interop.Window.KeyboardGrab(SwigCPtr, (uint)deviceSubclass);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Requests ungrab key events
+        /// </summary>
+        /// <returns>True if KeyboardUnGrab succeeds.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool KeyboardUnGrab()
+        {
+            bool ret = Interop.Window.KeyboardUnGrab(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
 
         /// <summary>
         /// Maximizes window's size.