Handlers

Handlers are User-defined event handlers that are defined in code, which provide custom behaviors attached to specific SA5 modules.

An example is hotkey handler installation. This block both registers a hotkey and defines the custom code to execute when the hotkey is pressed.

<script>
window.sa5 = window.sa5 || [];
window.sa5.push(['hotkeys', (hotkeyHandler) => {
  hotkeyHandler.register("f2", () => {
    console.log("f2 pressed");
  });
}]);
</script>

Notes

  • Handlers are classed, e.g. hotkeys to identify the module.

  • Each module has different capabilities, and will define its own API details for handlers.

Last updated

Was this helpful?