Link Search Menu Expand Document

SSpread.SetActionKey Method

Explanation Set a shortcut key to associate with a specific action.

Shortcut keys are initially set as follows.
Key Virtual key code Action
F2 113 Erase data in active cell
F3 114 Display the current date and time on a date or time cell
F4 115 Show pop-up calendar on date cell

These actions can be used in cells in input mode.

This method can disable these actions or assign a different key.
Call format SetActionKey(action, shift, ctrl, key)
Return value None
Arguments action Action to associate a shortcut key
Specify the following values.
Constant Value Description
$ActionKeyClear 0 Erase data in active cell
$ActionKeyCurrent 1 Display the current date and time on a date or time cell
$ActionKeyPopup 2 Show pop-up calendar on date cell
shift [Shift] key state ($TRUE or $FALSE)
ctrl [Ctrl] key state ($TRUE or $FALSE)
key Key associated with a specific action (any virtual key code can be used)
Exception EXT-1 The argument of SetActionKey is invalid
EXT-28 An error occurred in the SetActionKey method
Example of use
    SetActionKey($ActionKeyClear, $TRUE, $FALSE, 113); /* SHIFT+F2 */
    SetActionKey($ActionKeyCurrent, $FALSE, $TRUE, 113); /* CTRL+F2 */
    SetActionKey($ActionKeyPopup, $TRUE, $TRUE, 113); /* SHIFT+CTRL+F2 */
    
Related item GetActionKey method