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;
23 /// It inherits System.EventArgs.
24 /// The EcoreKeyEventArgs is an EventArgs to record the Ecore event's key name and key code.
26 /// <since_tizen> preview </since_tizen>
27 public class EcoreKeyEventArgs : EventArgs
30 /// Gets the KeyName property. The return type is string.
32 /// <since_tizen> preview </since_tizen>
33 public string KeyName { get; private set; }
35 /// Gets the KeyCode property. The return type is int.
37 /// <since_tizen> preview </since_tizen>
38 public int KeyCode { get; private set; }
41 /// Creates and initializes a new instance of the EcoreKeyEventArgs class.
43 /// <param name="data">data</param>
44 /// <param name="type">type</param>
45 /// <param name="info">information</param>
46 /// <returns>New instance of the EcoreKeyEventArgs class.</returns>
47 /// <since_tizen> preview </since_tizen>
48 public static EcoreKeyEventArgs Create(IntPtr data, EcoreEventType type, IntPtr info)
50 var evt = Marshal.PtrToStructure<EcoreEventKey>(info);
51 return new EcoreKeyEventArgs { KeyName = evt.keyname, KeyCode = (int)evt.keycode };
54 [StructLayout(LayoutKind.Sequential)]
57 public string keyname;
60 public string compose;
62 public IntPtr root_window;
63 public IntPtr event_window;
64 public uint timestamp;
65 public uint modifiers;
66 public int same_screen;