-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-mapper-tool-accessibility' of https://github.com/gi…
…thub/hotkey into chord-mapper
- Loading branch information
Showing
3 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>hotkey | Demo</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<button onclick="alert('clicked button 1!')" data-hotkey-scope="text-area-1" data-hotkey="Control+d,Meta+d">press meta+d or ctrl+d in text area 1 to click button 1</button><br> | ||
<textarea id="text-area-1" rows="4" cols="40">text area 1</textarea><br> | ||
<button onclick="alert('clicked button 2!')" data-hotkey-scope="text-area-2" data-hotkey="Control+d,Meta+d">press meta+d or ctrl+d in text area 2 to click button 2</button><br> | ||
<textarea id="text-area-2" rows="4" cols="40">text area 2</textarea><br> | ||
<label><input data-hotkey="t" type="text">Press t to focus this field</label><br> | ||
<label><input data-hotkey="r" type="checkbox">Press r to check/uncheck this checkbox</label><br> | ||
<a href="#ok" data-hotkey="o k">Press <kbd>o k</kbd> click this link</a> | ||
|
||
<script type="module"> | ||
// import {install} from '../dist/index.js' | ||
import {install} from 'https://unpkg.com/@github/hotkey@latest?module' | ||
|
||
for (const el of document.querySelectorAll('[data-hotkey]')) { | ||
install(el) | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters