Spread.Sheets Documentation > Developer's Guide > Managing the User Interface > Using Input Mapping |
You can change the keyboard keys that are used to trigger built-in actions to other keys. Actions include navigation, selection, cut, copy, paste, clear, undo, and redo.
This example specifies the keys for moving left.
JavaScript |
Copy Code
|
---|---|
//use Control+Shift+b spread.commandManager().setShortcutKey("navigationLeft","B".charCodeAt(0),true,true,false,false); |
This example changes the action of the default up and down arrow keys for the active cell.
JavaScript |
Copy Code
|
---|---|
var activeSheet = spread.getActiveSheet(); //Change the default Up arrow key action to "Page Up" for the active cell. spread.commandManager().setShortcutKey("navigationPageUp", GC.Spread.Commands.Key.up, false, false, false, false); //Change the default Down arrow key action to "Page Down" for the active cell. spread.commandManager().setShortcutKey("navigationPageDown", GC.Spread.Commands.Key.down, false, false, false, false); |
This example creates a custom action.
JavaScript |
Copy Code
|
---|---|
var activeSheet = spread.getActiveSheet(); //Map the created action to the Enter key. |