SpreadsheetKeyBehavior

Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior

The SpreadsheetKeyBehavior class carries out a Spreadsheet's keys, which SpreadsheetInputSetup gives it. Each key gets its own behavior, set up with one of the constants and whether it extends the selection. The keys follow Excel's. Keys for the spreadsheet do nothing while a cell is being edited; COMMIT_DOWN, COMMIT_UP, COMMIT_RIGHT, COMMIT_LEFT and CANCEL are for the edit field.

Example Code

use Libraries.Interface.Behaviors.Controls.SpreadsheetKeyBehavior
use Libraries.Game.InputSet
use Libraries.Game.InputTable
use Libraries.Interface.Events.KeyboardEvent
KeyboardEvent keys
InputSet downKey
downKey:SetKeyboardInput(keys:DOWN)
SpreadsheetKeyBehavior behavior
behavior:Setup(behavior:MOVE_DOWN, false)
InputTable table
table:SetIdentifier("MySpreadsheetKeys")
table:Add(downKey, behavior)

Variables

  • integer CANCEL: In the edit field: Escape.
  • integer PAGE_DOWN: Tab and Shift-Tab.
  • integer ENTER_UP: To the first cell.
  • integer PAGE_UP: To the last cell with data.
  • integer EDGE_RIGHT: To the first column of the row.
  • integer LAST: To the last cell with data.
  • integer NEXT: Tab and Shift-Tab.
  • integer HOME: To the first column of the row.
  • integer MOVE_UP
  • integer MOVE_RIGHT
  • integer MOVE_DOWN
  • integer MENU: Shift-F10 and the menu key.
  • integer PREVIOUS: Enter and Shift-Enter, when not editing: move down or up.
  • integer UNDO: Delete and Backspace: clear the selection.
  • integer COMMIT_DOWN: In the edit field: keep the edit and move.
  • integer EDGE_UP
  • integer SELECT_COLUMN
  • integer SELECT_EVERYTHING: F2: edit the cell's text.
  • integer COMMIT_LEFT: In the edit field: Escape.
  • integer REDO: Shift-F10 and the menu key.
  • integer ENTER_DOWN: Enter and Shift-Enter, when not editing: move down or up.
  • integer EDGE_LEFT
  • integer EDGE_DOWN
  • integer SELECT_ROW
  • integer INSERT: Control-Plus and Control-Minus.
  • integer COMMIT_UP: In the edit field: keep the edit and move.
  • integer COMMIT_RIGHT
  • integer EDIT: F2: edit the cell's text.
  • integer REMOVE: Control-Plus and Control-Minus.
  • integer MOVE_LEFT
  • integer FIRST: To the first cell.
  • integer CLEAR: Delete and Backspace: clear the selection.

Actions

GetCommand()

This action returns what the key does.

Returns

integer: The command.

IsFinished()

This action returns true: the key's work is done at once.

Returns

boolean: True.

Run(Libraries.Interface.Events.BehaviorEvent event)

This action carries out the key. The input tables call it, so most users won't need to.

Parameters

Setup(integer command, boolean extend)

This action chooses what the key does, and whether it extends the selection, as Shift does with the moving keys.

Parameters

  • command integer: What the key does, such as MOVE_DOWN.
  • extend boolean: True to extend the selection.

Example

use Libraries.Interface.Behaviors.Controls.SpreadsheetKeyBehavior
SpreadsheetKeyBehavior behavior
behavior:Setup(behavior:MOVE_DOWN, true)

Inherited Actions

6 actions from Libraries.Interface.Behaviors.Behavior
3 actions from Libraries.Language.Object