2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Runtime.InteropServices;
20 using Tizen.Internals;
25 /// It inherits System.EventArgs.
26 /// The EcoreKeyEventArgs is an EventArgs to record the Ecore event's key name and key code.
28 /// <since_tizen> preview </since_tizen>
29 [Obsolete("This has been deprecated in API12")]
30 public class EcoreKeyEventArgs : EventArgs
33 /// Gets the KeyName property. The return type is string.
35 /// <since_tizen> preview </since_tizen>
36 [Obsolete("This has been deprecated in API12")]
37 public string KeyName { get; private set; }
39 /// Gets the KeyCode property. The return type is int.
41 /// <since_tizen> preview </since_tizen>
42 [Obsolete("This has been deprecated in API12")]
43 public int KeyCode { get; private set; }
46 /// Creates and initializes a new instance of the EcoreKeyEventArgs class.
48 /// <param name="data">data</param>
49 /// <param name="type">type</param>
50 /// <param name="info">information</param>
51 /// <returns>New instance of the EcoreKeyEventArgs class.</returns>
52 /// <since_tizen> preview </since_tizen>
53 [Obsolete("This has been deprecated in API12")]
54 public static EcoreKeyEventArgs Create(IntPtr data, EcoreEventType type, IntPtr info)
56 var evt = Marshal.PtrToStructure<EcoreEventKey>(info);
57 return new EcoreKeyEventArgs { KeyName = evt.keyname, KeyCode = (int)evt.keycode };
60 [NativeStruct("Ecore_Event_Key", Include = "Elementary.h", PkgConfig = "elementary")]
61 [StructLayout(LayoutKind.Sequential)]
64 public string keyname;
67 public string compose;
69 public IntPtr root_window;
70 public IntPtr event_window;
71 public uint timestamp;
72 public uint modifiers;
73 public int same_screen;
77 public int event_flags;