Package ch.bailu.gtk.gdk
Class KeyEvent
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gdk.Event
ch.bailu.gtk.gdk.KeyEvent
- All Implemented Interfaces:
PointerInterface
An event related to a key-based device.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
int
Extracts the consumed modifiers from a key event.static int
int
Extracts the keycode from a key event.int
Extracts the keyval from a key event.int
Extracts the layout from a key event.int
getLevel()
Extracts the shift level from a key event.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
Extracts whether the key event is for a modifier key.int
matches
(int keyval, int modifiers) Matches a key event against a keyval and modifiers.Methods inherited from class ch.bailu.gtk.gdk.Event
getDevice, getDeviceTool, getDisplay, getEventSequence, getEventType, getModifierState, getPointerEmulated, getSeat, getSurface, getTime, ref, triggersContextMenu, unref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
KeyEvent
-
-
Method Details
-
getClassHandler
-
getConsumedModifiers
public int getConsumedModifiers()Extracts the consumed modifiers from a key event.- Returns:
- the consumed modifiers or @event
-
getKeycode
public int getKeycode()Extracts the keycode from a key event.- Returns:
- the keycode of @event
-
getKeyval
public int getKeyval()Extracts the keyval from a key event.- Returns:
- the keyval of @event
-
getLayout
public int getLayout()Extracts the layout from a key event.- Returns:
- the layout of @event
-
getLevel
public int getLevel()Extracts the shift level from a key event.- Returns:
- the shift level of @event
-
isModifier
public boolean isModifier()Extracts whether the key event is for a modifier key.- Returns:
- %TRUE if the @event is for a modifier key
-
matches
public int matches(int keyval, int modifiers) Matches a key event against a keyval and modifiers.
This is typically used to trigger keyboard shortcuts such as Ctrl-C.
Partial matches are possible where the combination matches
if the currently active group is ignored.
Note that we ignore Caps Lock for matching.- Parameters:
keyval
- the keyval to matchmodifiers
- the modifiers to match- Returns:
- a `GdkKeyMatch` value describing whether @event matches
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-