uk.ac.gate.guk.im
Class ShiftedKeys

java.lang.Object
  |
  +--uk.ac.gate.guk.im.ShiftedKeys

public class ShiftedKeys
extends java.lang.Object

Provides a way to manage the looks of your keyboard with respect to which key is the (un)shifted version of which other key. Only method is static xlate(char old, boolean shifted) which translates a char into how the result of pressing the same key with shift being in state shifted. Alternative method uses int old, so that you can use VK_... keycodes, too.


Field Summary
static int DEMAP
          Constant to select the DE (German) keymap.
static int KMAP
          Selects one keymap as currently active.
static int UKMAP
          Constant to select UK keymap.
static int USMAP
          Constant to select US keymap.
 
Constructor Summary
ShiftedKeys()
           
 
Method Summary
static void main(java.lang.String[] args)
          for testing
static char xlate(char old, boolean shifted)
          update / translate a char to reflect a new shift status
static char xlate(int old, boolean shifted)
          update / translate a char given as keycode to reflect a new shift status
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

USMAP

public static final int USMAP
Constant to select US keymap.

UKMAP

public static final int UKMAP
Constant to select UK keymap. Mostly like US but has one key more and uses the ', 2, 3 and upper left (accent) keys differently. Pound and NOT sign are only on UK, not US, and ` ~ @ # ' " are on different positions.

DEMAP

public static final int DEMAP
Constant to select the DE (German) keymap. Quite a few changes compared to UK: Shift numbers are used differently, 3 Umlaut keys replace the [{ ;: '" keys, shift ,. is now ;:, <> have a new key, -_ key is moved, the key next to Enter (UK style) is now #', ]} is now +*, and on the old -_ =+ positions we have an ß? and an accent key. Several of the US symbols therefore can only be reached with AltGr, which is a new shift that replaces right Alt. Those are: @{[]}\|~. Improvement is the better access to 3 types of accents and 3 umlauts (for a, o and u).

KMAP

public static int KMAP
Selects one keymap as currently active. This value holds one of the keymap selection constants. You can change it at runtime to select another than the default US keymap.
Constructor Detail

ShiftedKeys

public ShiftedKeys()
Method Detail

xlate

public static char xlate(char old,
                         boolean shifted)
update / translate a char to reflect a new shift status

xlate

public static char xlate(int old,
                         boolean shifted)
update / translate a char given as keycode to reflect a new shift status

main

public static void main(java.lang.String[] args)
for testing