sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    • Class for the registry of keyboard shortcuts. This is intended to be a singleton. You should not create a new instance, and only access this class from Blockly.ShortcutRegistry.registry.

      Returns Blockly.ShortcutRegistry

    Methods

    • Adds a mapping between a keycode and a keyboard shortcut.

      Parameters

      • keyCode: string | KeyCodes

        The key code for the keyboard shortcut. If registering a key code with a modifier (ex: ctrl+c) use Blockly.ShortcutRegistry.registry.createSerializedKey;

      • shortcutName: string

        The name of the shortcut to execute when the given keycode is pressed.

      • Optionalopt_allowCollision: boolean

        True to prevent an error when adding a shortcut to a key that is already mapped to a shortcut.

      Returns void

      if the given key code is already mapped to a shortcut.

    • Creates the serialized key code that will be used in the key map.

      Parameters

      • keyCode: number

        Number code representing the key.

      • modifiers: string[]

        List of modifier key codes to be used with the key. All valid modifiers can be found in the Blockly.ShortcutRegistry.modifierKeys.

      Returns string

      The serialized key code for the given modifiers and key.

    • Gets the serialized key codes that the shortcut with the given name is registered under.

      Parameters

      • shortcutName: string

        The name of the shortcut.

      Returns string[]

      An array with all the key codes the shortcut is registered under.

    • Gets the current key map.

      Returns { [key: string]: KeyboardShortcut[] }

      The object holding key codes to Blockly.ShortcutRegistry.KeyboardShortcut.

    • Gets the shortcuts registered to the given key code.

      Parameters

      • keyCode: string

        The serialized key code.

      Returns any

      The list of shortcuts to call when the given keyCode is used. Undefined if no shortcuts exist.

    • Handles key down events.

      Parameters

      • workspace: Blockly.Workspace

        The main workspace where the event was captured.

      • e: Event

        The key down event.

      Returns boolean

      True if the event was handled, false otherwise.

    • Registers a keyboard shortcut.

      Parameters

      • shortcut: KeyboardShortcut

        The shortcut for this key code.

      • Optionalopt_allowOverrides: boolean

        True to prevent a warning when overriding an already registered item.

      Returns void

      if a shortcut with the same name already exists.

    • Removes all the key mappings for a shortcut with the given name. Useful when changing the default key mappings and the key codes registered to the shortcut are unknown.

      Parameters

      • shortcutName: string

        The name of the shortcut to remove from the key map.

      Returns void

    • Removes a mapping between a keycode and a keyboard shortcut.

      Parameters

      • keyCode: string

        The key code for the keyboard shortcut. If registering a key code with a modifier (ex: ctrl+c) use Blockly.ShortcutRegistry.registry.createSerializedKey;

      • shortcutName: string

        The name of the shortcut to execute when the given keycode is pressed.

      • Optionalopt_quiet: boolean

        True to not console warn when there is no shortcut to remove.

      Returns boolean

      True if a key mapping was removed, false otherwise.

    • Sets the key map. Setting the key map will override any default key mappings.

      Parameters

      • keyMap: { [key: string]: string[] }

        The object with key code to shortcut names.

      Returns void

    • Unregisters a keyboard shortcut registered with the given key code. This will also remove any key mappings that reference this shortcut.

      Parameters

      • shortcutName: string

        The name of the shortcut to unregister.

      Returns boolean

      True if an item was unregistered, false otherwise.