[NUI] Add GetLastKeyEvent and GetLastTouchEvent api for Window
authorXianbing Teng <xb.teng@samsung.com>
Tue, 31 May 2022 07:18:37 +0000 (15:18 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 2 Jun 2022 09:14:59 +0000 (18:14 +0900)
src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window/Window.cs [changed mode: 0644->0755]

index 80c599a..c03effb 100755 (executable)
@@ -290,6 +290,12 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsWindowRotating")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool IsWindowRotating(global::System.Runtime.InteropServices.HandleRef window);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetLastKeyEvent")]
+            public static extern global::System.IntPtr GetLastKeyEvent(global::System.Runtime.InteropServices.HandleRef window);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetLastTouchEvent")]
+            public static extern global::System.IntPtr GetLastTouchEvent(global::System.Runtime.InteropServices.HandleRef window);
         }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 5e71d7d..b3834b0
@@ -1701,6 +1701,30 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Gets the last key event the window gets.
+        /// </summary>
+        /// <returns>The last key event the window gets.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Key GetLastKeyEvent()
+        {
+            Key ret = new Key(Interop.Window.GetLastKeyEvent(SwigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets the last touch event the window gets.
+        /// </summary>
+        /// <returns>The last touch event the window gets.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Touch GetLastTouchEvent()
+        {
+            Touch ret = new Touch(Interop.Window.GetLastTouchEvent(SwigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Add FrameUpdateCallback
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]