GcSpread.Sheets Namespace > Sheet type : addKeyMap Method |
true
if the action uses the Ctrl key; otherwise, false
.
true
if the action uses the Shift key; otherwise, false
.
true
if the action uses the Alt key; otherwise, false
.
true
if the action uses the Command key on the Macintosh or the Windows key on Microsoft Windows; otherwise, false
.
var instance = new GcSpread.Sheets.Sheet(name); var value; // Type: any value = instance.addKeyMap(keyCode, ctrl, shift, alt, meta, action);
true
if the action uses the Ctrl key; otherwise, false
.true
if the action uses the Shift key; otherwise, false
.true
if the action uses the Alt key; otherwise, false
.true
if the action uses the Command key on the Macintosh or the Windows key on Microsoft Windows; otherwise, false
.var activeSheet = spread.getActiveSheet(); //Change the default Up arrow key action to "Page Up" for the active cell. activeSheet.addKeyMap(GcSpread.Sheets.Key.up, false, false, false, false, GcSpread.Sheets.SpreadActions.navigationPageUp); //Change the default Down arrow key action to "Page Down" for the active cell. activeSheet.addKeyMap(GcSpread.Sheets.Key.down, false, false, false, false, GcSpread.Sheets.SpreadActions.navigationPageDown);
var activeSheet = spread.getActiveSheet(); //Map the created action to the Enter key. activeSheet.addKeyMap(GcSpread.Sheets.Key.enter, false, false, false, false, ColorAction); function ColorAction(){ //Click on a cell and press the Enter key. activeSheet.getCell(activeSheet.getActiveRowIndex(), activeSheet.getActiveColumnIndex()) .backColor("red"); }
sheet.addKeyMap("M".charCodeAt(0),true,true,false, GcSpread.Sheets.SpreadActions.navigationLeft);