|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
org.gnome.glib.Boxed
org.gnome.gdk.Event
org.gnome.gdk.EventKey
public final class EventKey
Event data describing a key press.
Method Summary | |
---|---|
Keyval |
getKeyval()
Get the key that was pressed. |
ModifierType |
getState()
Get the Flags object representing what modifiers are being held down, if any. |
Methods inherited from class org.gnome.gdk.Event |
---|
getType, getWindow |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Keyval getKeyval()
public ModifierType getState()
If you're only expecting a single modifier to be pressed then you could compare by equality:
if (mod == ModifierType.SHIFT_MASK) { ... }but if you're looking for more complex combinations, or worried that more than one modifier could be down, then use
contains()
:
if (mod.contains(ModifierType.CONTROL_MASK)) { ... }which will always do what you want.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |