: Download: FAQ: Licensing: Support: Contact ME
LwVCL Home
Introduction
Overview
Screen Shots
On-line Demos
Requirements
Further Plans
Docs
Tutorial
How-to (PDF)
API
FAQ
Download
Latest version

Home > J2SE > API

Overview  Package   Class  Tree  Deprecated  Index  Help 

org.zaval.lw.event
Class LwKeyEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.zaval.lw.event.LwVCLEvent
              |
              +--org.zaval.lw.event.LwKeyEvent
All Implemented Interfaces:
java.io.Serializable

public class LwKeyEvent
extends LwVCLEvent

This class is used with light weight components to describe keyboard events.

See Also:
Serialized Form

Field Summary
static int KEY_PRESSED
          The key pressed event type.
static int KEY_RELEASED
          The key released event type.
static int KEY_TYPED
          The key typed event type.
 
Fields inherited from class org.zaval.lw.event.LwVCLEvent
COMP_DISABLED, COMP_ENABLED, COMP_HIDDEN, COMP_SHOWN, COMP_UID, CONT_UID, FOCUS_GAINED, FOCUS_LOST, FOCUS_UID, id, KEY_UID, MOUSE_UID, uid
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LwKeyEvent(LwComponent target, int id, int code, char ch, int mask)
          Constructs the event object with the specified source object, the event id, the key code associated with the key, the character that has been typed with the key and the mask that describes state of a keyboard.
 
Method Summary
 char getKeyChar()
          Gets the key character that has been typed.
 int getKeyCode()
          Gets the key code associated with the key in the event.
 int getMask()
          Gets the keyboard mask.
 void reset(LwComponent target, int id, int code, char ch, int mask)
           
 
Methods inherited from class org.zaval.lw.event.LwVCLEvent
getID, getLwComponent, getUID
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_TYPED

public static final int KEY_TYPED
The key typed event type.

KEY_RELEASED

public static final int KEY_RELEASED
The key released event type.

KEY_PRESSED

public static final int KEY_PRESSED
The key pressed event type.
Constructor Detail

LwKeyEvent

public LwKeyEvent(LwComponent target,
                  int id,
                  int code,
                  char ch,
                  int mask)
Constructs the event object with the specified source object, the event id, the key code associated with the key, the character that has been typed with the key and the mask that describes state of a keyboard.
Parameters:
target - the object where the event originated.
id - the specified event id.
code - the specified key code associated with the key.
ch - the specified key character.
mask - the specified key mask. Using the mask you can define for example status of "Ctrl", "Alt", "Shift" and so on keys.
Method Detail

reset

public void reset(LwComponent target,
                  int id,
                  int code,
                  char ch,
                  int mask)

getKeyCode

public int getKeyCode()
Gets the key code associated with the key in the event.
Returns:
a key code.

getKeyChar

public char getKeyChar()
Gets the key character that has been typed.
Returns:
a key character.

getMask

public int getMask()
Gets the keyboard mask. The mask can be used to test if the "Ctrl", "Alt" and so on keys are pressed or not. Use java.awt.event.InputEvent key modifiers constants for the purpose.
Returns:
a keyboard mask.


: up