Skip to content

Hot Strokes

We can register the handlers for the key strokes with _spy.registerHotStroke().

js
const {
  unregisterHotStroke,
} = _spy.registerHotStroke("hello", () => {
  console.log("world");
  unregisterHotStroke();
});

Hot Strokes that've been set as default

#strokewhat will happen
1spyshows spy log dialog
2styleshows ad hoc style editor

How to change the default hot strokes

_spy has the methods to change the strokes.

js
// spy -> myspy
_spy.changeHotStrokeSpy("myspy");

// style -> mystyle
_spy.changeHostStrokeStyle("mystyle");

How to unregister the default hot strokes

js
_spy.unregisterHotStroke();

How to get the registered hot strokes

js
_spy.getRegisteredHotStrokes();
// ["spy", "style", "somestroke"]