charva.awt.event

Class KeyEvent


public class KeyEvent
extends InputEvent

An event which indicates that a keystroke occurred in an object.

Field Summary

static char
CHAR_UNDEFINED
KEY_PRESSED events that don't map to a valid character cause the keyPressed() method to return this value.
static int
KEY_PRESSED
static int
KEY_TYPED
static int
VK_BACK_SPACE
static int
VK_BACK_TAB
static int
VK_DELETE
static int
VK_DOWN
static int
VK_END
static int
VK_ENTER
static int
VK_ESCAPE
static int
VK_F1
static int
VK_F10
static int
VK_F11
static int
VK_F12
static int
VK_F13
static int
VK_F14
static int
VK_F15
static int
VK_F16
static int
VK_F17
static int
VK_F18
static int
VK_F19
static int
VK_F2
static int
VK_F20
static int
VK_F3
static int
VK_F4
static int
VK_F5
static int
VK_F6
static int
VK_F7
static int
VK_F8
static int
VK_F9
static int
VK_HOME
static int
VK_INSERT
static int
VK_LEFT
static int
VK_PAGE_DOWN
static int
VK_PAGE_UP
static int
VK_RIGHT
static int
VK_UP

Fields inherited from class charva.awt.event.AWTEvent

ACTION_PERFORMED, ADJUSTMENT_EVENT, FOCUS_GAINED, FOCUS_LOST, GARBAGE_COLLECTION, INVOCATION_EVENT, ITEM_STATE_CHANGED, KEY_PRESSED, KEY_TYPED, LIST_SELECTION, MOUSE_EVENT, PAINT_EVENT, RESERVED_ID_MAX, SCROLL_EVENT, SYNC_EVENT, WINDOW_CLOSING, WINDOW_OPENED

Constructor Summary

KeyEvent(int key_, int id_, Component source_)

Method Summary

char
getKeyChar()
Return the character (in the case of a KEY_TYPED event).
int
getKeyCode()
Return the integer key code.
boolean
isActionKey()
Returns true if the key code is greater than 255, indicating that it is a function key.
void
setKeyCode(int key_)
Set the key code to indicate a physical key was pressed
String
toString()

Methods inherited from class charva.awt.event.InputEvent

consume, isConsumed

Methods inherited from class charva.awt.event.AWTEvent

getID

Field Details

CHAR_UNDEFINED

public static final char CHAR_UNDEFINED
KEY_PRESSED events that don't map to a valid character cause the keyPressed() method to return this value.
Field Value:
'\uffff'

KEY_PRESSED

public static final int KEY_PRESSED
Field Value:
1

KEY_TYPED

public static final int KEY_TYPED
Field Value:
2

VK_BACK_SPACE

public static final int VK_BACK_SPACE
Field Value:
263

VK_BACK_TAB

public static final int VK_BACK_TAB
Field Value:
353

VK_DELETE

public static final int VK_DELETE
Field Value:
330

VK_DOWN

public static final int VK_DOWN
Field Value:
258

VK_END

public static final int VK_END
Field Value:
360

VK_ENTER

public static final int VK_ENTER
Field Value:
343

VK_ESCAPE

public static final int VK_ESCAPE
Field Value:
27

VK_F1

public static final int VK_F1
Field Value:
265

VK_F10

public static final int VK_F10
Field Value:
274

VK_F11

public static final int VK_F11
Field Value:
275

VK_F12

public static final int VK_F12
Field Value:
276

VK_F13

public static final int VK_F13
Field Value:
277

VK_F14

public static final int VK_F14
Field Value:
278

VK_F15

public static final int VK_F15
Field Value:
279

VK_F16

public static final int VK_F16
Field Value:
280

VK_F17

public static final int VK_F17
Field Value:
281

VK_F18

public static final int VK_F18
Field Value:
282

VK_F19

public static final int VK_F19
Field Value:
283

VK_F2

public static final int VK_F2
Field Value:
266

VK_F20

public static final int VK_F20
Field Value:
284

VK_F3

public static final int VK_F3
Field Value:
267

VK_F4

public static final int VK_F4
Field Value:
268

VK_F5

public static final int VK_F5
Field Value:
269

VK_F6

public static final int VK_F6
Field Value:
270

VK_F7

public static final int VK_F7
Field Value:
271

VK_F8

public static final int VK_F8
Field Value:
272

VK_F9

public static final int VK_F9
Field Value:
273

VK_HOME

public static final int VK_HOME
Field Value:
262

VK_INSERT

public static final int VK_INSERT
Field Value:
331

VK_LEFT

public static final int VK_LEFT
Field Value:
260

VK_PAGE_DOWN

public static final int VK_PAGE_DOWN
Field Value:
338

VK_PAGE_UP

public static final int VK_PAGE_UP
Field Value:
339

VK_RIGHT

public static final int VK_RIGHT
Field Value:
261

VK_UP

public static final int VK_UP
Field Value:
259

Constructor Details

KeyEvent

public KeyEvent(int key_,
                int id_,
                Component source_)

Method Details

getKeyChar

public char getKeyChar()
Return the character (in the case of a KEY_TYPED event).

getKeyCode

public int getKeyCode()
Return the integer key code.

isActionKey

public boolean isActionKey()
Returns true if the key code is greater than 255, indicating that it is a function key.

setKeyCode

public void setKeyCode(int key_)
Set the key code to indicate a physical key was pressed

toString

public String toString()