Input Hotkey API

Allows keyboard shortcuts (hotkeys) to be bound to an element's click event.


    class="btn btn-default"
    onclick="alert('B is for Banana!')">
    Press "B" on your keyboard

    class="btn btn-default"
    onclick="confirm('Shift gears...?')">
    Press "Shift + R" on your keyboard

Javascript API

If you use a selector other than a button or a link, you will need to add the hotkeyVisible property to the hotkey config.

    hotkey: 'ctrl+s, cmd+s',
    hotkeyVisible: false,
    callback: doSomething
Copyright © 2024 Winter CMS
Edit on GitHub