public class KeyboardEvent extends BogusEvent
BogusEvent
specialization that
encapsulates a KeyboardShortcut
. Keyboard shortcuts may be
of one form out of two: 1. A single Character; or, 2. A modifier mask (such as: (ALT |
SHIFT)) plus a virtual-key.
Note that virtual key codes are used to report which keyboard key has been pressed, rather than a character generated by the combination of one or more keystrokes (such as "A", which comes from shift and "a"). Their values depend on the platform your running your code. In Java, for instance, have a look at KeyEvent to get some VK_* values. Note that Proscene sets them automatically from the platform where the framework is running.
ALT, ALT_GRAPH, CTRL, META, NO_ID, NO_MODIFIER_MASK, SHIFT
Constructor and Description |
---|
KeyboardEvent(char _key) |
KeyboardEvent(int vk)
Constructs a keyboard event with c defining its
KeyboardShortcut . |
KeyboardEvent(int modifiers,
int vk)
Constructs a keyboard event with the modifiers and vk defining its
KeyboardShortcut . |
Modifier and Type | Method and Description |
---|---|
KeyboardEvent |
fire()
Same as
this.get() but sets the BogusEvent.fired() flag to true. |
KeyboardEvent |
flush()
Same as
this.get() but sets the BogusEvent.flushed() flag to true. |
KeyboardEvent |
get()
Returns a deep copy of the object.
|
char |
key() |
KeyboardShortcut |
shortcut() |
equals, fired, flushed, hashCode, id, isAltDown, isAltGraph, isControlDown, isMetaDown, isNull, isShiftDown, modifiers, modifiersText, timestamp
public KeyboardEvent(int modifiers, int vk)
KeyboardShortcut
.public KeyboardEvent(int vk)
KeyboardShortcut
.public KeyboardEvent(char _key)
public KeyboardEvent get()
Copyable
Typical implementation should simple look like: return new Object(this)
.
get
in interface Copyable
get
in class BogusEvent
public KeyboardEvent flush()
BogusEvent
this.get()
but sets the BogusEvent.flushed()
flag to true. Only agents
may call this.flush
in class BogusEvent
BogusEvent.flushed()
public KeyboardEvent fire()
BogusEvent
this.get()
but sets the BogusEvent.fired()
flag to true. Only agents
may call this.fire
in class BogusEvent
BogusEvent.flushed()
public KeyboardShortcut shortcut()
shortcut
in class BogusEvent
Shortcut
public char key()
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia