From 49ba707675659b6be9df4e84def06cf1f02303db Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Mon, 16 Feb 2004 21:32:22 +0000 Subject: [PATCH] oops, cvs add first, you moron svn path=/trunk/gtk-sharp/; revision=23150 --- gdk/EventKey.cs | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 gdk/EventKey.cs diff --git a/gdk/EventKey.cs b/gdk/EventKey.cs new file mode 100644 index 000000000..a6c074c28 --- /dev/null +++ b/gdk/EventKey.cs @@ -0,0 +1,62 @@ +// Gdk.EventKey.cs - Custom key event wrapper +// +// Author: Mike Kestner +// +// (c) 2004 Novell, Inc. + +namespace Gdk { + + using System; + using System.Runtime.InteropServices; + + public class EventKey : Event { + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_key_get_time (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_key_get_state (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_key_get_keyval (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern ushort gtksharp_gdk_event_key_get_hardware_keycode (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern byte gtksharp_gdk_event_key_get_group (IntPtr evt); + + public EventKey (IntPtr raw) : base (raw) {} + + public uint Time { + get { + return gtksharp_gdk_event_key_get_time (Handle); + } + } + + public ModifierType State { + get { + return (ModifierType) gtksharp_gdk_event_key_get_state (Handle); + } + } + + public uint KeyValue { + get { + return gtksharp_gdk_event_key_get_keyval (Handle); + } + } + + public ushort HardwareKeycode { + get { + return gtksharp_gdk_event_key_get_hardware_keycode (Handle); + } + } + + public byte Group { + get { + return gtksharp_gdk_event_key_get_group (Handle); + } + } + } +} +