Documentation
    Preparing search index...

    Function createKeysService

    • Create a keys service handler.

      Attaches a single keydown listener to options.listenerTarget (default document). Matching chord subscriptions invoke options.onForward with a DOM-shape payload AND push a keys.action envelope back to the owning napplet via the per-window send callback captured at keys.registerAction time. Returns a ServiceHandler augmented with a destroy() method that detaches the listener and clears all registries.

      Parameters

      • options: KeysServiceOptions = {}

        Optional configuration (onForward callback, listenerTarget)

      Returns ServiceHandler & { destroy(): void }

      A ServiceHandler (with destroy()) to register with the runtime

      import { createKeysService } from '@kehto/services';

      const keys = createKeysService({
      onForward: (event) => shellHotkeyDispatcher.execute(event),
      });

      runtime.registerService('keys', keys);
      // Later, on shell teardown:
      keys.destroy();