From 97ea6608331988b90953def4f905b7c886aba6a2 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Fri, 25 Aug 2023 13:50:49 +0900 Subject: [PATCH] Binding KeyboardGrab and KeyboardUnGrab 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/internal/Interop/Interop.Window.cs | 8 +++++++ src/Tizen.NUI/src/public/Window/Window.cs | 25 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 3b3714f..558e41f 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -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); } } } diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index 3a60ec5..3956b86 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -1891,6 +1891,31 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Requests grab key events according to the requested device subtype + /// + /// The deviceSubclass type. + /// True if KeyboardGrab succeeds. + [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; + } + + /// + /// Requests ungrab key events + /// + /// True if KeyboardUnGrab succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool KeyboardUnGrab() + { + bool ret = Interop.Window.KeyboardUnGrab(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Maximizes window's size. -- 2.7.4