NarraLeaf

KeyBindingType

KeyBindingType is an enumeration that represents built-in keyboard binding action identifiers used by the KeyMap of the game.

enum KeyBindingType {
    skipAction = "skipAction",
    nextAction = "nextAction",
}

Members

skipAction

When the player presses one of the bound keys, the game will advance to the next sentence.

  • Default binding: [" "] (space key)

Since 0.26.0, a click on the stage does the same thing as one press of this key: it completes the line being typed, and advances a line that has finished. Before that, only this key advanced an ADV dialog — a click was recognised and emitted, and nothing moved, so a game whose players click to read did not advance at all. NVL dialogs have always listened to both.

Holding the key still forces on through the scene; a click never does, because a player who clicks has asked for one line rather than for the rest of the scene.

nextAction

When the player presses one of the bound keys, the game will skip the current action.

  • Default binding: ["Control"]

Example

// Change the skip action key to F3
game.keyMap.setKeyBinding(KeyBindingType.skipAction, "F3");
// Bind both Control and F3 to skipAction
game.keyMap.setKeyBinding(KeyBindingType.skipAction, ["Control", "F3"]);
// Remove the binding
game.keyMap.setKeyBinding(KeyBindingType.skipAction, null);

See also: KeyBindingValue, KeyMap.

On this page