public class KeyboardRemapper extends Object implements TerminalKeys
KEY_AlternateCursor, KEY_Attention, KEY_Backspace, KEY_BackwardWordTab, KEY_CapsLock, KEY_Clear, KEY_CmdKey, KEY_CursorDown, KEY_CursorDownFast, KEY_CursorLeft, KEY_CursorLeftFast, KEY_CursorRight, KEY_CursorRightFast, KEY_CursorSelect, KEY_CursorUp, KEY_CursorUpFast, KEY_Delete, KEY_DestructiveBackspace, KEY_Dup, KEY_End, KEY_Enter, KEY_EraseEOF, KEY_EraseInput, KEY_FieldExit, KEY_FieldMark, KEY_FieldMinus, KEY_FieldPlus, KEY_ForwardWordTab, KEY_Help, KEY_Home, KEY_Insert, KEY_InsertToggle, KEY_LeftTab, KEY_MinusSign, KEY_NewLine, KEY_PA1, KEY_PA2, KEY_PA3, KEY_PageDown, KEY_PageUp, KEY_PF1, KEY_PF10, KEY_PF11, KEY_PF12, KEY_PF13, KEY_PF14, KEY_PF15, KEY_PF16, KEY_PF17, KEY_PF18, KEY_PF19, KEY_PF2, KEY_PF20, KEY_PF21, KEY_PF22, KEY_PF23, KEY_PF24, KEY_PF3, KEY_PF4, KEY_PF5, KEY_PF6, KEY_PF7, KEY_PF8, KEY_PF9, KEY_PlusSign, KEY_Print, KEY_PrintPC, KEY_PrintPS, KEY_RecordBackspace, KEY_Reset, KEY_RightTab, KEY_Space, KEY_SystemRequest, KEY_Test, KEY_WordDelete
Constructor and Description |
---|
KeyboardRemapper()
Creates a keyboard remapper with the defaults.
|
KeyboardRemapper(KeyboardRemapper kr)
Creates a keyboard remapper with the settings from another keyboard remapper.
|
KeyboardRemapper(PhantomFile file)
Initializes the keyboard map from a file.
|
Modifier and Type | Method and Description |
---|---|
void |
addKey(int key,
int[] augmentations)
Adds a key with augmentations.
|
static KeyboardRemapper |
cloneCurrentKeyboardRemapper()
Creates a clone of the current manager.
|
static int[] |
getDefaultSendKeys(int key)
Gets default settings for a key.
|
static int |
getHostKey(int index)
Gets the host key value from an index.
|
static int |
getKeyFromName(String name)
Gets the key from a key name.
|
static int |
getKeyIndex(int key)
Gets the index of a key for the key names table.
|
static String |
getKeyName(int key)
Gets the name for a key.
|
static String[] |
getKeyNames()
Returns an enumeration of String object instance of
all available key strings.
|
int[] |
getKeys()
Gets the enumeration of defined keys.
|
int[] |
getSendKeys(int key)
Gets the send keys for all the augmentation keys assigned on a particular key.
|
static void |
initializeKeyboardRemapper(PhantomFile file)
Initializes the keyboard map from a file.
|
static void |
installKeyboardRemapper(KeyboardRemapper kr)
Installs a new keyboard mapper as the current one.
|
static void |
installKeyboardRemapper(KeyboardRemapper kr,
boolean doLogEvent)
Installs a new keyboard mapper as the current one.
|
static int |
mapToDefaultSendKey(int key,
boolean isShift,
boolean isControl,
boolean isAlt)
Default keyboard mapper.
|
static int |
mapToSendKey(int key,
boolean isShift,
boolean isControl,
boolean isAlt)
Default keyboard mapper.
|
int |
mapToSendKey2(int key,
boolean isShift,
boolean isControl,
boolean isAlt)
Custom keyboard mapper.
|
boolean |
saveToFile()
Saves the current definition to the default file "ProgramName.keyboardMap".
|
void |
writeToFile(PhantomOutputFile file)
Writes the definition of the keyboard map to the file.
|
public KeyboardRemapper()
public KeyboardRemapper(KeyboardRemapper kr)
KeyboardRemapper kr
is null, a default
remapper is created.public KeyboardRemapper(PhantomFile file) throws IOException
IOException
- when a file error occurs.public static void initializeKeyboardRemapper(PhantomFile file) throws IOException
IOException
- when a file error occurs.public static String getKeyName(int key)
public static int getKeyIndex(int key)
public static int getHostKey(int index)
public static String[] getKeyNames()
public static int getKeyFromName(String name)
public static KeyboardRemapper cloneCurrentKeyboardRemapper()
public static void installKeyboardRemapper(KeyboardRemapper kr)
public static void installKeyboardRemapper(KeyboardRemapper kr, boolean doLogEvent)
doLogEvent
flag will cause (or not) an event
to be written in the event log.public static int mapToSendKey(int key, boolean isShift, boolean isControl, boolean isAlt)
public static int mapToDefaultSendKey(int key, boolean isShift, boolean isControl, boolean isAlt)
public static int[] getDefaultSendKeys(int key)
public int mapToSendKey2(int key, boolean isShift, boolean isControl, boolean isAlt)
public boolean saveToFile()
public void writeToFile(PhantomOutputFile file) throws IOException
IOException
- when a file error occurs.public final int[] getKeys()
public final int[] getSendKeys(int key)
The augmentation keys table:
0 - Shift=0, Control=0, Alt=0: No augmentation 1 - Shift=1, Control=0, Alt=0: Shift 2 - Shift=0, Control=1, Alt=0: Control 3 - Shift=1, Control=1, Alt=0: Shift+Control 4 - Shift=0, Control=0, Alt=1: Alt 5 - Shift=1, Control=0, Alt=1: Shift+Alt 6 - Shift=0, Control=1, Alt=1: Control+Alt 7 - Shift=1, Control=1, Alt=1: Shift+Control+Alt
public void addKey(int key, int[] augmentations)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.