SpreadJS Documentation > Sample Code > Sample Code for Keyboard and Input Maps > Changing the Default Input Map |
You can change the default key actions.
This example changes default up and down actions to page up and page down when changing the active cell.
JavaScript |
Copy Code
|
---|---|
$(document).ready(function () { var spread = new GcSpread.Sheets.Spread($("#ss").get(0),{sheetCount:3}); var activeSheet = spread.getActiveSheet(); //Change Up key action in cells to "Page Up". activeSheet.addKeyMap(GcSpread.Sheets.Key.up, false, false, false, false, GcSpread.Sheets.SpreadActions.navigationPageUp); //Change Down key action in cells to "Page Down". activeSheet.addKeyMap(GcSpread.Sheets.Key.down, false, false, false, false, GcSpread.Sheets.SpreadActions.navigationPageDown); }); |