ewe.ui
Interface IKeys

All Superinterfaces:
IFunctionKeys, IKeypadKeys

public interface IKeys
extends IFunctionKeys, IKeypadKeys

IKeys is an interface containing values for special keys and modifiers.

Below is an example of IKeys being used.

 public void onEvent(Event event)
  {
  if (event.type == KeyEvent.KEY_PRESS)
   {
   KeyEvent ke = (KeyEvent)event;
   if ((ke.modifiers & CONTROL) > 0)
      ... control key was held down
   if (ke.key == PAGE_DOWN)
      ... page down key pressed
 


Field Summary
static int ACTION
          Action Button.
static int ALT
          modifier for alt key
static int BACKSPACE
          special key
static int COMMAND
          special key
static int CONDITIONAL
          For PRESSED KeyEvents, indicates that the key that was typed should be considered "conditional" - that is it may be superceded by another key.
static int CONTROL
          modifier for control key
static int DELETE
          special key
static int DOWN
          special key
static int END
          special key
static int ENTER
          special key
static int ESCAPE
          special key
static int FROM_INPUT_METHOD
          This indicates that the KeyEvent was generated by an InputMethod.
static int HELP
          special key
static int HOME
          special key
static int INSERT
          special key
static int INVISIBLE
          modifier used when specifying hot keys - indicates that the key should not be underlined.
static int KEY_PRESSED
          This mask should be applied to the result of Vm.getAsyncKeyState(int keyCode).
static int KEY_WASPRESSED
          This mask should be applied to the result of Vm.getAsyncKeyState(int keyCode).
static int LEFT
          special key
static int MENU
          special key
static int MULTICHARACTER
          For PRESSED KeyEvents, indicates that the text element has a multi-character string that should be considered as entered by the user.
static int NEXT_CONTROL
          special key
static int NEXT_TAB
          special key
static int ONLY
          modifier used when specifying hot keys - indicates that the key alone with no modifier must be pressed.
static int PAGE_DOWN
          special key
static int PAGE_UP
          special key
static int PDA_CANCEL
          special key
static int PEN
          Left Mouse Button or Pen
static int PREV_CONTROL
          special key
static int PREV_TAB
          special key
static int REPEATED
          For PRESSED KeyEvents, indicates that the key press is generated because the key is being held down.
static int REPLACEMENT
          For PRESSED KeyEvents, indicates that the key that was typed should be considered to replace the previously sent key press.
static int RIGHT
          special key
static int SHIFT
          modifier for shift key
static int SOFTKEY1
          special key
static int SOFTKEY2
          special key
static int SPECIAL
          modifier for special keys
static int TAB
          special key
static int UP
          special key
 
Fields inherited from interface ewe.ui.IFunctionKeys
APP0, APP1, APP10, APP11, APP12, APP13, APP14, APP15, APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9
 
Fields inherited from interface ewe.ui.IKeypadKeys
KEYPAD_0, KEYPAD_1, KEYPAD_2, KEYPAD_3, KEYPAD_4, KEYPAD_5, KEYPAD_6, KEYPAD_7, KEYPAD_8, KEYPAD_9, KEYPAD_DEL, KEYPAD_DIVIDE, KEYPAD_DOWN, KEYPAD_END, KEYPAD_ENTER, KEYPAD_HOME, KEYPAD_INS, KEYPAD_LEFT, KEYPAD_MINUS, KEYPAD_PAGE_DOWN, KEYPAD_PAGE_UP, KEYPAD_PLUS, KEYPAD_POINT, KEYPAD_RIGHT, KEYPAD_TIMES, KEYPAD_UP
 

Field Detail

ALT

public static final int ALT
modifier for alt key

See Also:
Constant Field Values

CONTROL

public static final int CONTROL
modifier for control key

See Also:
Constant Field Values

SHIFT

public static final int SHIFT
modifier for shift key

See Also:
Constant Field Values

SPECIAL

public static final int SPECIAL
modifier for special keys

See Also:
Constant Field Values

ONLY

public static final int ONLY
modifier used when specifying hot keys - indicates that the key alone with no modifier must be pressed.

See Also:
Constant Field Values

INVISIBLE

public static final int INVISIBLE
modifier used when specifying hot keys - indicates that the key should not be underlined.

See Also:
Constant Field Values

REPEATED

public static final int REPEATED
For PRESSED KeyEvents, indicates that the key press is generated because the key is being held down.

See Also:
Constant Field Values

MULTICHARACTER

public static final int MULTICHARACTER
For PRESSED KeyEvents, indicates that the text element has a multi-character string that should be considered as entered by the user.

See Also:
Constant Field Values

CONDITIONAL

public static final int CONDITIONAL
For PRESSED KeyEvents, indicates that the key that was typed should be considered "conditional" - that is it may be superceded by another key.

See Also:
Constant Field Values

REPLACEMENT

public static final int REPLACEMENT
For PRESSED KeyEvents, indicates that the key that was typed should be considered to replace the previously sent key press. This may be used in combination with CONDITIONAL to indicate that this replacement may also be conditional.

See Also:
Constant Field Values

FROM_INPUT_METHOD

public static final int FROM_INPUT_METHOD
This indicates that the KeyEvent was generated by an InputMethod.

See Also:
Constant Field Values

PAGE_UP

public static final int PAGE_UP
special key

See Also:
Constant Field Values

PAGE_DOWN

public static final int PAGE_DOWN
special key

See Also:
Constant Field Values

HOME

public static final int HOME
special key

See Also:
Constant Field Values

END

public static final int END
special key

See Also:
Constant Field Values

UP

public static final int UP
special key

See Also:
Constant Field Values

DOWN

public static final int DOWN
special key

See Also:
Constant Field Values

LEFT

public static final int LEFT
special key

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
special key

See Also:
Constant Field Values

INSERT

public static final int INSERT
special key

See Also:
Constant Field Values

ENTER

public static final int ENTER
special key

See Also:
Constant Field Values

TAB

public static final int TAB
special key

See Also:
Constant Field Values

BACKSPACE

public static final int BACKSPACE
special key

See Also:
Constant Field Values

ESCAPE

public static final int ESCAPE
special key

See Also:
Constant Field Values

DELETE

public static final int DELETE
special key

See Also:
Constant Field Values

MENU

public static final int MENU
special key

See Also:
Constant Field Values

COMMAND

public static final int COMMAND
special key

See Also:
Constant Field Values

HELP

public static final int HELP
special key

See Also:
Constant Field Values

PDA_CANCEL

public static final int PDA_CANCEL
special key

See Also:
Constant Field Values

NEXT_TAB

public static final int NEXT_TAB
special key

See Also:
Constant Field Values

PREV_TAB

public static final int PREV_TAB
special key

See Also:
Constant Field Values

NEXT_CONTROL

public static final int NEXT_CONTROL
special key

See Also:
Constant Field Values

PREV_CONTROL

public static final int PREV_CONTROL
special key

See Also:
Constant Field Values

SOFTKEY1

public static final int SOFTKEY1
special key

See Also:
Constant Field Values

SOFTKEY2

public static final int SOFTKEY2
special key

See Also:
Constant Field Values

PEN

public static final int PEN
Left Mouse Button or Pen

See Also:
Constant Field Values

ACTION

public static final int ACTION
Action Button. On my Casio it is 0x86

See Also:
Constant Field Values

KEY_PRESSED

public static final int KEY_PRESSED
This mask should be applied to the result of Vm.getAsyncKeyState(int keyCode). If it is set then the key is being pressed at the time the method was called. See also: KEY_WASPRESSED which is just as important to ensure you do not miss key presses.

See Also:
Constant Field Values

KEY_WASPRESSED

public static final int KEY_WASPRESSED
This mask should be applied to the result of Vm.getAsyncKeyState(int keyCode). If it is set then the key was pressed at least once since the last call to getAsyncKeyState(). If you are doing a long process and want to be interrupted by a keypress then do this: // First wait until the key is not being pressed. while((Vm.getAsyncKeyState(ExitKeyCode) & (IKeys.KEY_PRESSED|IKeys.KEY_WASPRESSED)) != 0) Vm.sleep(100); // Now enter your loop. while(workingHard){ doTheWork(); if ((Vm.getAsyncState(ExitKeyCode) & (IKeys.KEY_PRESSED|IKeys.KEY_WASPRESSED)) != 0) { cancelled = true; break; }

See Also:
Constant Field Values