https://github.com/kyle-west/power-access
Provide your users with power keyboard shortcuts
https://github.com/kyle-west/power-access
Last synced: 3 months ago
JSON representation
Provide your users with power keyboard shortcuts
- Host: GitHub
- URL: https://github.com/kyle-west/power-access
- Owner: kyle-west
- Created: 2018-09-17T13:54:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T14:40:28.000Z (over 6 years ago)
- Last Synced: 2025-01-10T04:24:42.087Z (5 months ago)
- Language: HTML
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# power-access
This is a native web component that allows for an accessibility layer on top of
your web application.# Register Shortcut
```js
let registrar = new KeyboardShortcutRegistrar();
registrar.register(options, callback)
```### Options
```js
let options = {
keyStroke: 'Control+c', // The key stroke that fires the callback
displayKeys: ' + c', // The text shown in place of keyStroke to user (if supplied)
label: 'Copy text to the clipboard' // The description shown to the user of the action
hidden: false; // [OPTIONAL] default:false, show the shortcut in the power-access menu
}
```# Shortcut Menu
```html
...
```
# Inject HTML / Styles
> As of version 1.0.0, the `` component no longer uses ShadowDOM, so HTML injection may no longer be needed by your application.Use the following to inject an additional stylesheet into the component:
```js
document.querySelector('power-access').injectHTML = `
`
```