com.guiseframework.platform.web
Enum KeyCode

java.lang.Object
  extended by java.lang.Enum<KeyCode>
      extended by com.guiseframework.platform.web.KeyCode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<KeyCode>

public enum KeyCode
extends java.lang.Enum<KeyCode>

A key on a keyboard as reported by a browser's Event.keyCode property.

Author:
Garret Wilson

Enum Constant Summary
ALT
           
BACKSPACE
           
CONTROL
           
DELETE
           
DOWN
           
END
           
ENTER
           
ESCAPE
           
F1
           
F10
           
F11
           
F12
           
F2
           
F3
           
F4
           
F5
           
F6
           
F7
           
F8
           
F9
           
HOME
           
LEFT
           
PAGE_DOWN
           
PAGE_UP
           
RIGHT
           
SHIFT
           
TAB
           
UP
           
 
Method Summary
 int getCode()
           
 Key getKey()
           
static KeyCode valueOf(int code)
          Retrieves a key code corresponding to the given code.
static KeyCode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static KeyCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ALT

public static final KeyCode ALT

BACKSPACE

public static final KeyCode BACKSPACE

CONTROL

public static final KeyCode CONTROL

DELETE

public static final KeyCode DELETE

DOWN

public static final KeyCode DOWN

END

public static final KeyCode END

ENTER

public static final KeyCode ENTER

ESCAPE

public static final KeyCode ESCAPE

F1

public static final KeyCode F1

F2

public static final KeyCode F2

F3

public static final KeyCode F3

F4

public static final KeyCode F4

F5

public static final KeyCode F5

F6

public static final KeyCode F6

F7

public static final KeyCode F7

F8

public static final KeyCode F8

F9

public static final KeyCode F9

F10

public static final KeyCode F10

F11

public static final KeyCode F11

F12

public static final KeyCode F12

HOME

public static final KeyCode HOME

LEFT

public static final KeyCode LEFT

PAGE_UP

public static final KeyCode PAGE_UP

PAGE_DOWN

public static final KeyCode PAGE_DOWN

RIGHT

public static final KeyCode RIGHT

SHIFT

public static final KeyCode SHIFT

TAB

public static final KeyCode TAB

UP

public static final KeyCode UP
Method Detail

values

public static KeyCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (KeyCode c : KeyCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static KeyCode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getCode

public int getCode()
Returns:
The code reported by the browser.

getKey

public Key getKey()
Returns:
The key this key code represents.

valueOf

public static KeyCode valueOf(int code)
Retrieves a key code corresponding to the given code.

Parameters:
code - The code for which a key code should be returned.
Returns:
The key code representing the given code.
Throws:
java.lang.IllegalArgumentException - if the given code does not match one of the known key codes.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.