Skip to content
pixi-silk
GitHub repository
Function

bindHistoryKeys

import { bindHistoryKeys } from 'pixi-silk/history';
function bindHistoryKeys(history: {
  redo: unknown;
  undo: unknown;
}, options?: HistoryKeysOptions): () => void;

Binds cmd or ctrl + Z to undo, and shift + cmd or ctrl + Z and ctrl + Y to redo. Keys typed into inputs, text areas and editable elements are left alone. Returns the unbind function.

Parameters#

ParameterType
history{ redo: unknown; undo: unknown; }
history.redo
history.undo
optionsHistoryKeysOptions

Returns#

() => void