@witchcraft/spellcraft
    Preparing search index...
    • The manager is not designed to react to setting a key's pressed state directly only to events to then set the key state.

      So this method is provided to allow a "virtual" press (i.e. by some method that is not a real key press such as directly clicking on a visual representation of the key), without having to use the Emulator.

      It takes care of changing the key press state, and adding the key to the chain.

      Note that it is more simplistic and less "precise" than the emulator. It will ignore the type of toggles (native toggles will be treated as emulated). If using Manager.options.updateStateOnAllEvents, you will probably want to temporarily disable it or the state of the key press might get immediately reset.

      There is also virtualRelease and virtualToggle.

      Parameters

      • manager: Manager
      • keyIdOrVariant: string

      Returns void