Download the PHP package gaomingcode/hotkeys without Composer
On this page you can find all versions of the php package gaomingcode/hotkeys. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gaomingcode/hotkeys
More information about gaomingcode/hotkeys
Files in gaomingcode/hotkeys
Package hotkeys
Short Description A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
License MIT
Homepage http://jaywcjlove.github.io/hotkeys
Informations about the package hotkeys
Hotkeys
Installation
Composer
ReadMe from Origin
HotKeys.js is an input capture library with some very special features, it is easy to pick up and use, has a reasonable footprint (~3kb) (gzipped: 1.73kb), and has no dependencies. It should not interfere with any JavaScript libraries or frameworks. Official document demo preview. More examples.
Usage
You will need Node.js
installed on your system.
Or manually download and link hotkeys.js in your HTML, It can also be downloaded via UNPKG:
CDN: UNPKG | jsDelivr | Githack | Statically | bundle.run
Used in React
react-hotkeys is the React component that listen to keydown and keyup keyboard events, defining and dispatching keyboard shortcuts. Detailed use method please see its documentation react-hotkeys.
react-hotkeys-hook - React hook for using keyboard shortcuts in components. Make sure that you have at least version 16.8 of react and react-dom installed, or otherwise hooks won't work for you.
Browser Support
Hotkeys.js has been tested and should work in.
Supported Keys
HotKeys understands the following modifiers: ⇧
, shift
, option
, ⌥
, alt
, ctrl
, control
, command
, and ⌘
.
The following special keys can be used for shortcuts: backspace, tab, clear, enter, return, esc, escape, space, up, down, left, right, home, end, pageup, pagedown, del, delete and f1 through f19.
⌘
Command()
⌃
Control
⌥
Option(alt)
⇧
Shift
⇪
Caps Lock(Capital)
fn
Does not support fn
↩︎
return/Enter space
Defining Shortcuts
One global method is exposed, key which defines shortcuts when called directly.
option
scope<String>
element<HTMLElement>
keyup<Boolean>
keydown<Boolean>
splitKey<string>
(default is+
)
API REFERENCE
Asterisk "*"
Modifier key judgments
setScope
Use the hotkeys.setScope
method to set scope. There can only be one active scope besides 'all'. By default 'all' is always active.
getScope
Use the hotkeys.getScope
method to get scope.
deleteScope
Use the hotkeys.deleteScope
method to delete a scope. This will also remove all associated hotkeys with it.
unbind
Similar to defining shortcuts, they can be unbound using hotkeys.unbind
.
Unbind events through functions.
To unbind everything.
isPressed
For example, hotkeys.isPressed(77)
is true if the M
key is currently pressed.
keyup
key down and key up both perform callback events.
getPressedKeyCodes
Returns an array of key codes currently pressed.
filter
By default hotkeys are not enabled for INPUT
SELECT
TEXTAREA
elements. Hotkeys.filter
to return to the true
shortcut keys set to play a role, false
shortcut keys set up failure.
noConflict
Relinquish HotKeys’s control of the hotkeys
variable.
Development
To develop, Install dependencies, Get the code:
To develop, run the self-reloading build:
Run Document Website Environment.
To contribute, please fork Hotkeys.js, add your patch and tests for it (in the test/
folder) and submit a pull request.
License
MIT © Kenny Wong