Java DTV API 1.3
18-Nov-2009

com.sun.dtv.ui.event
Class RemoteControlEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.awt.AWTEvent
          extended by java.awt.event.ComponentEvent
              extended by java.awt.event.InputEvent
                  extended by java.awt.event.KeyEvent
                      extended by com.sun.dtv.ui.event.KeyEvent
                          extended by com.sun.dtv.ui.event.RemoteControlEvent
All Implemented Interfaces:
ScarceResource, UserInputEvent, Serializable

public class RemoteControlEvent
extends KeyEvent

This class extends the KeyEvent class by adding TV remote specific key codes.

See Also:
Serialized Form

Field Summary
static int VK_ARROWS
          Any arrow key.
static int VK_BACK
          Back key code.
static int VK_BALANCE_LEFT
          Balance left key code.
static int VK_BALANCE_RIGHT
          Balance right key code.
static int VK_BASS_DOWN
          Bass down key code.
static int VK_BASS_UP
          Bass up key code.
static int VK_CHANNEL_DOWN
          Channel down key code.
static int VK_CHANNEL_UP
          Channel up key code.
static int VK_COLORED
          Any colored key.
static int VK_COLORED_KEY_0
          Colored key 0 key code.
static int VK_COLORED_KEY_1
          Colored key 1 key code.
static int VK_COLORED_KEY_2
          Colored key 2 key code.
static int VK_COLORED_KEY_3
          Colored key 3 key code.
static int VK_COLORED_KEY_4
          Colored key 4 key code.
static int VK_COLORED_KEY_5
          Colored key 5 key code.
static int VK_CONFIRM
          Confirm key code.
static int VK_DIMMER
          Device dimmer key code.
static int VK_DISPLAY_SWAP
          Display swap key code.
static int VK_EJECT
          Eject button key code.
static int VK_FADER_FRONT
          Fader front key code.
static int VK_FADER_REAR
          Fader rear key code.
static int VK_FF
          Fast forward (FF) button key code.
static int VK_GO_TO_END
          Go to end position key code.
static int VK_GO_TO_NEXT
          Go to next position key code.
static int VK_GO_TO_PREV
          Go to previous position key code.
static int VK_GO_TO_START
          Go to start position key code.
static int VK_GUIDE
          Program guide key code.
static int VK_INFO
          Info key code.
static int VK_MENU
          Menu key code.
static int VK_MUTE
          Mute key code.
static int VK_PIP
          Picture in picture (PIP) key code.
static int VK_PLAY
          Play (PLAY) button key code.
static int VK_PLAY_SPEED_DOWN
          Decrease media speed key code.
static int VK_PLAY_SPEED_RESET
          Reset media speed key code.
static int VK_PLAY_SPEED_UP
          Increase media speed key code.
static int VK_POWER
          Device power on/off key code.
static int VK_RANDOM_PLAY
          Random play key code.
static int VK_RECORD
          Record (REC) button key code.
static int VK_REWIND
          Rewind (REW) button key code.
static int VK_SCAN_CHANNEL
          Scan channel key code.
static int VK_SCREEN_MODE
          Screen mode change key code.
static int VK_SPLIT_SCREEN
          Split screen key code.
static int VK_STOP
          Stop (STOP) button key code.
static int VK_SUBTITLE_MODE
          Subtitle mode change key code.
static int VK_SURROUND_MODE
          Surround mode change key code.
static int VK_TELETEXT
          Teletext key code.
static int VK_VIDEO_MODE
          Video mode change key code.
static int VK_VOLUME_DOWN
          Volume down key code.
static int VK_VOLUME_UP
          Volume up key code.
static int VK_WINK
          Device wink key code.
 
Fields inherited from class java.awt.event.KeyEvent
CHAR_UNDEFINED, KEY_FIRST, KEY_LAST, KEY_PRESSED, KEY_RELEASED, KEY_TYPED, VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9, VK_A, VK_ACCEPT, VK_ADD, VK_AGAIN, VK_ALL_CANDIDATES, VK_ALPHANUMERIC, VK_ALT, VK_ALT_GRAPH, VK_AMPERSAND, VK_ASTERISK, VK_AT, VK_B, VK_BACK_QUOTE, VK_BACK_SLASH, VK_BACK_SPACE, VK_BRACELEFT, VK_BRACERIGHT, VK_C, VK_CANCEL, VK_CAPS_LOCK, VK_CIRCUMFLEX, VK_CLEAR, VK_CLOSE_BRACKET, VK_CODE_INPUT, VK_COLON, VK_COMMA, VK_COMPOSE, VK_CONTROL, VK_CONVERT, VK_COPY, VK_CUT, VK_D, VK_DEAD_ABOVEDOT, VK_DEAD_ABOVERING, VK_DEAD_ACUTE, VK_DEAD_BREVE, VK_DEAD_CARON, VK_DEAD_CEDILLA, VK_DEAD_CIRCUMFLEX, VK_DEAD_DIAERESIS, VK_DEAD_DOUBLEACUTE, VK_DEAD_GRAVE, VK_DEAD_IOTA, VK_DEAD_MACRON, VK_DEAD_OGONEK, VK_DEAD_SEMIVOICED_SOUND, VK_DEAD_TILDE, VK_DEAD_VOICED_SOUND, VK_DECIMAL, VK_DELETE, VK_DIVIDE, VK_DOLLAR, VK_DOWN, VK_E, VK_END, VK_ENTER, VK_EQUALS, VK_ESCAPE, VK_EURO_SIGN, VK_EXCLAMATION_MARK, VK_F, VK_F1, VK_F10, VK_F11, VK_F12, VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F2, VK_F20, VK_F21, VK_F22, VK_F23, VK_F24, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_FINAL, VK_FIND, VK_FULL_WIDTH, VK_G, VK_GREATER, VK_H, VK_HALF_WIDTH, VK_HELP, VK_HIRAGANA, VK_HOME, VK_I, VK_INPUT_METHOD_ON_OFF, VK_INSERT, VK_INVERTED_EXCLAMATION_MARK, VK_J, VK_JAPANESE_HIRAGANA, VK_JAPANESE_KATAKANA, VK_JAPANESE_ROMAN, VK_K, VK_KANA, VK_KANA_LOCK, VK_KANJI, VK_KATAKANA, VK_KP_DOWN, VK_KP_LEFT, VK_KP_RIGHT, VK_KP_UP, VK_L, VK_LEFT, VK_LEFT_PARENTHESIS, VK_LESS, VK_M, VK_META, VK_MINUS, VK_MODECHANGE, VK_MULTIPLY, VK_N, VK_NONCONVERT, VK_NUM_LOCK, VK_NUMBER_SIGN, VK_NUMPAD0, VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_NUMPAD7, VK_NUMPAD8, VK_NUMPAD9, VK_O, VK_OPEN_BRACKET, VK_P, VK_PAGE_DOWN, VK_PAGE_UP, VK_PASTE, VK_PAUSE, VK_PERIOD, VK_PLUS, VK_PREVIOUS_CANDIDATE, VK_PRINTSCREEN, VK_PROPS, VK_Q, VK_QUOTE, VK_QUOTEDBL, VK_R, VK_RIGHT, VK_RIGHT_PARENTHESIS, VK_ROMAN_CHARACTERS, VK_S, VK_SCROLL_LOCK, VK_SEMICOLON, VK_SEPARATER, VK_SEPARATOR, VK_SHIFT, VK_SLASH, VK_SPACE, VK_SUBTRACT, VK_T, VK_TAB, VK_U, VK_UNDEFINED, VK_UNDERSCORE, VK_UNDO, VK_UP, VK_V, VK_W, VK_X, VK_Y, VK_Z
 
Fields inherited from class java.awt.event.InputEvent
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK
 
Fields inherited from class java.awt.event.ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RemoteControlEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar)
          Constructs a RemoteControlEvent object.
 
Method Summary
static void addResourceTypeListener(ResourceTypeListener listener)
          Adds a ResourceTypeListener to the implementation.
static KeyEvent[] getInstances()
          Return the list of all existing instances of RemoteControlEvent, whether they are already reserved or not.
static void removeResourceTypeListener(ResourceTypeListener listener)
          Removes a previously attached listener.
static KeyEvent reserveOne(int keyCode, boolean force, long timeoutms, ScarceResourceListener listener)
          Returns a reserved instance out of the pool of all RemoteControlEvent instances.
 
Methods inherited from class com.sun.dtv.ui.event.KeyEvent
isAvailable, release, reserve
 
Methods inherited from class java.awt.event.KeyEvent
getKeyChar, getKeyCode, getKeyModifiersText, getKeyText, isActionKey, paramString, setKeyChar, setKeyCode, setSource
 
Methods inherited from class java.awt.event.InputEvent
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class java.awt.event.ComponentEvent
getComponent
 
Methods inherited from class java.awt.AWTEvent
getID, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VK_COLORED_KEY_0

public static final int VK_COLORED_KEY_0
Colored key 0 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_COLORED_KEY_1

public static final int VK_COLORED_KEY_1
Colored key 1 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_COLORED_KEY_2

public static final int VK_COLORED_KEY_2
Colored key 2 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_COLORED_KEY_3

public static final int VK_COLORED_KEY_3
Colored key 3 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_COLORED_KEY_4

public static final int VK_COLORED_KEY_4
Colored key 4 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_COLORED_KEY_5

public static final int VK_COLORED_KEY_5
Colored key 5 key code. A remote control may have up to six colored keys.

See Also:
Constant Field Values

VK_POWER

public static final int VK_POWER
Device power on/off key code.

See Also:
Constant Field Values

VK_DIMMER

public static final int VK_DIMMER
Device dimmer key code.

See Also:
Constant Field Values

VK_WINK

public static final int VK_WINK
Device wink key code.

See Also:
Constant Field Values

VK_REWIND

public static final int VK_REWIND
Rewind (REW) button key code.

See Also:
Constant Field Values

VK_STOP

public static final int VK_STOP
Stop (STOP) button key code.

See Also:
Constant Field Values

VK_EJECT

public static final int VK_EJECT
Eject button key code.

See Also:
Constant Field Values

VK_PLAY

public static final int VK_PLAY
Play (PLAY) button key code.

See Also:
Constant Field Values

VK_RECORD

public static final int VK_RECORD
Record (REC) button key code.

See Also:
Constant Field Values

VK_FF

public static final int VK_FF
Fast forward (FF) button key code.

See Also:
Constant Field Values

VK_PLAY_SPEED_UP

public static final int VK_PLAY_SPEED_UP
Increase media speed key code.

See Also:
Constant Field Values

VK_PLAY_SPEED_DOWN

public static final int VK_PLAY_SPEED_DOWN
Decrease media speed key code.

See Also:
Constant Field Values

VK_PLAY_SPEED_RESET

public static final int VK_PLAY_SPEED_RESET
Reset media speed key code.

See Also:
Constant Field Values

VK_GO_TO_NEXT

public static final int VK_GO_TO_NEXT
Go to next position key code.

See Also:
Constant Field Values

VK_GO_TO_START

public static final int VK_GO_TO_START
Go to start position key code.

See Also:
Constant Field Values

VK_GO_TO_END

public static final int VK_GO_TO_END
Go to end position key code.

See Also:
Constant Field Values

VK_GO_TO_PREV

public static final int VK_GO_TO_PREV
Go to previous position key code.

See Also:
Constant Field Values

VK_RANDOM_PLAY

public static final int VK_RANDOM_PLAY
Random play key code.

See Also:
Constant Field Values

VK_CHANNEL_UP

public static final int VK_CHANNEL_UP
Channel up key code.

See Also:
Constant Field Values

VK_CHANNEL_DOWN

public static final int VK_CHANNEL_DOWN
Channel down key code.

See Also:
Constant Field Values

VK_SCAN_CHANNEL

public static final int VK_SCAN_CHANNEL
Scan channel key code.

See Also:
Constant Field Values

VK_PIP

public static final int VK_PIP
Picture in picture (PIP) key code.

See Also:
Constant Field Values

VK_SPLIT_SCREEN

public static final int VK_SPLIT_SCREEN
Split screen key code.

See Also:
Constant Field Values

VK_DISPLAY_SWAP

public static final int VK_DISPLAY_SWAP
Display swap key code.

See Also:
Constant Field Values

VK_SCREEN_MODE

public static final int VK_SCREEN_MODE
Screen mode change key code.

See Also:
Constant Field Values

VK_VIDEO_MODE

public static final int VK_VIDEO_MODE
Video mode change key code.

See Also:
Constant Field Values

VK_VOLUME_UP

public static final int VK_VOLUME_UP
Volume up key code.

See Also:
Constant Field Values

VK_VOLUME_DOWN

public static final int VK_VOLUME_DOWN
Volume down key code.

See Also:
Constant Field Values

VK_MUTE

public static final int VK_MUTE
Mute key code.

See Also:
Constant Field Values

VK_SURROUND_MODE

public static final int VK_SURROUND_MODE
Surround mode change key code.

See Also:
Constant Field Values

VK_BALANCE_RIGHT

public static final int VK_BALANCE_RIGHT
Balance right key code.

See Also:
Constant Field Values

VK_BALANCE_LEFT

public static final int VK_BALANCE_LEFT
Balance left key code.

See Also:
Constant Field Values

VK_FADER_FRONT

public static final int VK_FADER_FRONT
Fader front key code.

See Also:
Constant Field Values

VK_FADER_REAR

public static final int VK_FADER_REAR
Fader rear key code.

See Also:
Constant Field Values

VK_BASS_UP

public static final int VK_BASS_UP
Bass up key code.

See Also:
Constant Field Values

VK_BASS_DOWN

public static final int VK_BASS_DOWN
Bass down key code.

See Also:
Constant Field Values

VK_INFO

public static final int VK_INFO
Info key code.

See Also:
Constant Field Values

VK_GUIDE

public static final int VK_GUIDE
Program guide key code.

See Also:
Constant Field Values

VK_TELETEXT

public static final int VK_TELETEXT
Teletext key code.

See Also:
Constant Field Values

VK_SUBTITLE_MODE

public static final int VK_SUBTITLE_MODE
Subtitle mode change key code.

See Also:
Constant Field Values

VK_CONFIRM

public static final int VK_CONFIRM
Confirm key code.

See Also:
Constant Field Values

VK_BACK

public static final int VK_BACK
Back key code.

See Also:
Constant Field Values

VK_MENU

public static final int VK_MENU
Menu key code.

See Also:
Constant Field Values

VK_COLORED

public static final int VK_COLORED
Any colored key.

See Also:
Constant Field Values

VK_ARROWS

public static final int VK_ARROWS
Any arrow key.

See Also:
Constant Field Values
Constructor Detail

RemoteControlEvent

public RemoteControlEvent(Component source,
                          int id,
                          long when,
                          int modifiers,
                          int keyCode,
                          char keyChar)
Constructs a RemoteControlEvent object.

Parameters:
source - the Component that originated the event
id - an integer identifying the type of event
when - a long integer that specifies the time the event occurred
modifiers - the modifier keys down during event (shift, ctrl, alt, meta) Either extended _DOWN_MASK or old _MASK modifiers should be used, but both models should not be mixed in one event. Use of the extended modifiers is preferred.
keyCode - the integer code for an actual key, or VK_UNDEFINED (for a key-typed event) (as defined in java.awt.event.KeyEvent)
keyChar - the Unicode character generated by this event, or CHAR_UNDEFINED (for key-pressed and key-released events which do not map to a valid Unicode character) (as defined in java.awt.event.KeyEvent)
See Also:
KeyEvent
Method Detail

reserveOne

public static KeyEvent reserveOne(int keyCode,
                                  boolean force,
                                  long timeoutms,
                                  ScarceResourceListener listener)
                           throws IllegalArgumentException,
                                  TimeoutException
Returns a reserved instance out of the pool of all RemoteControlEvent instances. This method either returns with the instance or throws an exception according to the situation.

This method behaves exactly as the reserve() method.

This method overrides the one defined in KeyEvent.

Parameters:
keyCode - the integer code for an actual key, or VK_UNDEFINED (for a key-typed event) (as defined in java.awt.event.KeyEvent)
force - If true, this method is allowed to withdraw any given resource from its current owner. If false, the implementation will block and wait until a resource of the given type is made available (using release()) or until timeoutms milliseconds.
timeoutms - A positive amount of time in millisecond until which this method will wait for any resource to be released by its current owner. The value of -1 indicates that the implementation will wait forever.
listener - The listener to be attached to receive notification about the status of the resource.
Returns:
The instance of type RemoteControlEvent that has been reserved.
Throws:
IllegalArgumentException - If listener is null or if the value specified in timeoutms is not valid i.e. not either a positive integer or -1.
TimeoutException - If the time specified in timeoutms is over and the resource could not be reserved.
See Also:
KeyEvent.reserve(boolean, long, com.sun.dtv.resources.ScarceResourceListener)

getInstances

public static KeyEvent[] getInstances()
Return the list of all existing instances of RemoteControlEvent, whether they are already reserved or not. This method overrides the one defined in KeyEvent.

Returns:
list of all existing instances of RemoteControlEvent

addResourceTypeListener

public static void addResourceTypeListener(ResourceTypeListener listener)
                                    throws NullPointerException
Adds a ResourceTypeListener to the implementation. Whenever a reserve() or a release() is called on any resources of the same type, the implementation will call the listener's corresponding methods.

Parameters:
listener - The listener that is triggered for events on resources of the same type.
Throws:
NullPointerException - If listener is null.
See Also:
removeResourceTypeListener(com.sun.dtv.resources.ResourceTypeListener)

removeResourceTypeListener

public static void removeResourceTypeListener(ResourceTypeListener listener)
                                       throws NullPointerException
Removes a previously attached listener. If the listener was not attached before, this method does nothing.

Parameters:
listener - The listener that is triggered for events on resources of the same type.
Throws:
NullPointerException - If listener is null.
See Also:
addResourceTypeListener(com.sun.dtv.resources.ResourceTypeListener)

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.