Package com.iizix.term
Class KeyboardRemapper
java.lang.Object
com.iizix.term.KeyboardRemapper
- All Implemented Interfaces:
- TerminalKeys
The keyboard remapper that maps KeyEvents to Send Keys.
- Field Summary- Fields inherited from interface com.iizix.term.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 SummaryConstructorsConstructorDescriptionCreates a keyboard remapper with the defaults.Creates a keyboard remapper with the settings from another keyboard remapper.- KeyboardRemapper- (XFile file) Initializes the keyboard map from a file.
- Method SummaryModifier and TypeMethodDescription- void- addKey- (int key, int[] augmentations) Adds a key with augmentations.- static KeyboardRemapperCreates 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[]Returns an enumeration of String object instance of all available key strings.- int[]- getKeys()Gets the array of defined keys.- int[]- getSendKeys- (int key) Gets the send keys for all the augmentation keys assigned on a particular key.Gets the table for Terminal remap.- static voidInitializes the keyboard map from a file.- static voidInstalls 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 remapper.- static int- mapToSendKey- (int key, boolean isShift, boolean isControl, boolean isAlt) Default keyboard remapper.- int- mapToSendKey2- (int key, boolean isShift, boolean isControl, boolean isAlt) Custom keyboard remapper.- booleanSaves the current definition to the default file "ProgramName.keyboardMap".- void- writeToFile- (XOutputFile file) Writes the definition of the keyboard map to the file.
- Constructor Details- KeyboardRemapperpublic KeyboardRemapper()Creates a keyboard remapper with the defaults.
- KeyboardRemapperCreates a keyboard remapper with the settings from another keyboard remapper. If the parameter- KeyboardRemapper kris null, a default remapper is created.
- KeyboardRemapperInitializes the keyboard map from a file.- Throws:
- IOException- when a file error occurs.
 
 
- Method Details- initializeKeyboardRemapperInitializes the keyboard map from a file.- Throws:
- IOException- when a file error occurs.
 
- getKeyNameGets the name for a key.- Returns:
- null if not found.
 
- getKeyIndexpublic static int getKeyIndex- (int key) Gets the index of a key for the key names table.- Returns:
- -1 if not found.
 
- getHostKeypublic static int getHostKey- (int index) Gets the host key value from an index.
- getKeyNamesReturns an enumeration of String object instance of all available key strings.
- getKeyFromNameGets the key from a key name.- Returns:
- -1 if not found.
 
- cloneCurrentKeyboardRemapperCreates a clone of the current manager.
- installKeyboardRemapperInstalls a new keyboard mapper as the current one.
- installKeyboardRemapperInstalls a new keyboard mapper as the current one. The- doLogEventflag will cause (or not) an event to be written in the event log.
- mapToSendKeypublic static int mapToSendKey- (int key, boolean isShift, boolean isControl, boolean isAlt) Default keyboard remapper.- Returns:
- the send key used by HostSession.sendKey, or -1 for no valid send key.
 
- mapToDefaultSendKeypublic static int mapToDefaultSendKey- (int key, boolean isShift, boolean isControl, boolean isAlt) Default keyboard remapper.- Returns:
- the send key used by HostSession.sendKey, -1 for no valid send key.
 
- getDefaultSendKeyspublic static int[] getDefaultSendKeys- (int key) Gets default settings for a key.
- mapToSendKey2public int mapToSendKey2- (int key, boolean isShift, boolean isControl, boolean isAlt) Custom keyboard remapper.- Returns:
- the send key used by HostSession.sendKey, -1 for no valid send key.
 
- saveToFilepublic boolean saveToFile()Saves the current definition to the default file "ProgramName.keyboardMap".
- writeToFileWrites the definition of the keyboard map to the file.- Throws:
- IOException- when a file error occurs.
 
- getKeyspublic int[] getKeys()Gets the array of defined keys.
- getSendKeyspublic int[] getSendKeys- (int key) Gets the send keys for all the augmentation keys assigned on a particular 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 
- addKeypublic void addKey- (int key, int[] augmentations) Adds a key with augmentations.
- getTerminalMapGets the table for Terminal remap.