|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.commands.Command com.hdcookbook.grin.input.RCKeyEvent
public class RCKeyEvent
This class is used to manage constants related to the remote control keys. Instances of RCKeyEvent can be queued as GRIN commands; when they are executed, the show will process the keystroke. The built-in RCKeyEvent class is used for key pressed and key released events, taken from a strictly limited set of keys.
If desired, a GRIN extension can subclass RCKeyEvent to add support for key typed events. GRIN doesn't really support key typed events, but it does provide support for queuing them and dispatching them in the animation thread (as is done with key pressed and released events).
Fields inherited from class com.hdcookbook.grin.commands.Command |
---|
show |
Constructor Summary | |
---|---|
protected |
RCKeyEvent(int keyCode,
int mask)
Initialize a new key typed event. |
Method Summary | |
---|---|
void |
execute()
Execute the command. |
void |
execute(Show caller)
Execute the command. |
int |
getBitMask()
A bitmask value is assigned to each remote control key. |
static java.util.Vector |
getEventsFromMask(int mask)
Returns a vector of events turned-on by the given mask. |
static RCKeyEvent |
getKeyByEventCode(int key)
Look up the RCKeyEvent corresponding to a VK_ key code. |
static RCKeyEvent |
getKeyByName(java.lang.String name)
Look up the RCKeyEvent by its logical name. |
int |
getKeyCode()
|
RCKeyEvent |
getKeyReleased()
Give the RCKeyEvent for this VK code that represents a key release. |
java.lang.String |
getName()
Get a developer-friendly name of this key event. |
boolean |
isKeyPress()
Return true if this is represents key press, and false if it represents a key release. |
Methods inherited from class com.hdcookbook.grin.commands.Command |
---|
cloneIfNeeded, deferNextCommands, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static RCKeyEvent KEY_0
public static RCKeyEvent KEY_1
public static RCKeyEvent KEY_2
public static RCKeyEvent KEY_3
public static RCKeyEvent KEY_4
public static RCKeyEvent KEY_5
public static RCKeyEvent KEY_6
public static RCKeyEvent KEY_7
public static RCKeyEvent KEY_8
public static RCKeyEvent KEY_9
public static RCKeyEvent KEY_RIGHT
public static RCKeyEvent KEY_LEFT
public static RCKeyEvent KEY_UP
public static RCKeyEvent KEY_DOWN
public static RCKeyEvent KEY_ENTER
public static RCKeyEvent KEY_POPUP_MENU
public static RCKeyEvent KEY_PLAY
public static RCKeyEvent KEY_STOP
public static RCKeyEvent KEY_STILL_OFF
public static RCKeyEvent KEY_TRACK_NEXT
public static RCKeyEvent KEY_TRACK_PREV
public static RCKeyEvent KEY_FAST_FWD
public static RCKeyEvent KEY_REWIND
public static RCKeyEvent KEY_PAUSE
public static RCKeyEvent KEY_SECONDARY_VIDEO_ENABLE_DISABLE
public static RCKeyEvent KEY_SECONDARY_AUDIO_ENABLE_DISABLE
public static RCKeyEvent KEY_PG_TEXTST_ENABLE_DISABLE
public static RCKeyEvent KEY_INFO
public static RCKeyEvent KEY_RED
AssetFinder.getColorKeyCode(java.awt.Color)
public static RCKeyEvent KEY_GREEN
AssetFinder.getColorKeyCode(java.awt.Color)
public static RCKeyEvent KEY_YELLOW
AssetFinder.getColorKeyCode(java.awt.Color)
public static RCKeyEvent KEY_BLUE
AssetFinder.getColorKeyCode(java.awt.Color)
Constructor Detail |
---|
protected RCKeyEvent(int keyCode, int mask)
Not all GEM devices support key typed events, nor do they have keyboards. If you extend GRIN to add support for key typed events, it's up to you how to generate the needed key typed events, e.g. by perhaps adding a virtual keyboard.
NOTE: If you subclass RCKeyEvent, be sure to override execute(Show)
keyCode
- The VK code of the key. This can be zero. A subclass
will likely add a char data member to contain the
character that is typed.mask
- The bitmask of this key event. A bit in the bitmask
can be used to identify groups of related keys. The
bitmask is used to identify whether or not a segment
is interested in receiving key typed events from the
corresponding key group.execute(Show)
,
Segment.keyTypedInterest
Method Detail |
---|
public java.lang.String getName()
public int getKeyCode()
public int getBitMask()
public boolean isKeyPress()
public RCKeyEvent getKeyReleased()
public void execute(Show caller)
This version of execute(Show) is only for use by the built-in GRIN support for key pressed and key released events. If you subclass RCKeyEvent to support key typed events, be sure to override this method so that it calls Show.internalHandleKeyTypedEvent().
execute
in class Command
caller
- The show that is executing this command. This might
not be the same as the show this command was created
under.public void execute()
execute
in class Command
public static RCKeyEvent getKeyByEventCode(int key)
This returns the RCKeyEvent corresponding to a key press.
getKeyReleased()
public static RCKeyEvent getKeyByName(java.lang.String name)
public static java.util.Vector getEventsFromMask(int mask)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |