hotkey-router 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -670
- package/data/browser-hotkeys.json +40 -0
- package/data/site-hotkeys.json +1 -1
- package/data/site-hotkeys.runtime.json +1 -1
- package/dist/auto.js +3 -3
- package/dist/auto.js.map +2 -2
- package/dist/auto.min.js +2 -2
- package/dist/core.js +55 -324
- package/dist/core.js.map +3 -3
- package/dist/dev.js +56 -0
- package/dist/dev.js.map +7 -0
- package/dist/format.js +13 -178
- package/dist/format.js.map +3 -3
- package/dist/hotkey-router.cjs +69 -165
- package/dist/hotkey-router.cjs.map +3 -3
- package/dist/hotkey-router.js +1 -1
- package/dist/hotkey-router.js.map +2 -2
- package/dist/hotkey-router.min.js +2 -2
- package/dist/lookup.js +9 -0
- package/dist/lookup.js.map +7 -0
- package/dist/parse.js +207 -0
- package/dist/parse.js.map +7 -0
- package/dist/platform.js +42 -0
- package/dist/platform.js.map +7 -0
- package/dist/reservations.js +17 -533
- package/dist/reservations.js.map +3 -3
- package/dist/shifted-punctuation.js +34 -0
- package/dist/shifted-punctuation.js.map +7 -0
- package/dist/sites.js +4 -203
- package/dist/sites.js.map +3 -3
- package/dist/testing.js +104 -0
- package/dist/testing.js.map +7 -0
- package/dist/types/core.d.ts +3 -9
- package/dist/types/dev.d.ts +48 -0
- package/dist/types/lookup.d.ts +1 -0
- package/dist/types/parse.d.ts +0 -13
- package/dist/types/reservations.d.ts +14 -41
- package/dist/types/shifted-punctuation.d.ts +17 -0
- package/dist/types/testing.d.ts +17 -0
- package/dist/validate.js +11 -191
- package/dist/validate.js.map +3 -3
- package/package.json +9 -1
package/dist/reservations.js
CHANGED
|
@@ -1,506 +1,20 @@
|
|
|
1
|
-
// hotkey-router v0.
|
|
1
|
+
// hotkey-router v0.6.0 | SEE LICENSE IN LICENSE
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
$comment: "Machine-readable companion to docs/browser-hotkeys.md. Each combo entry describes who claims the binding and how strongly. Intended for runtime conflict warnings in keyboard-routing libraries (e.g. hotkey-router) and dev-time validation in apps like WebRadar. Update both this file and the markdown together \u2014 the markdown is the human source of truth, this file is the machine projection.",
|
|
7
|
-
version: {
|
|
8
|
-
generated: "2026-10-29",
|
|
9
|
-
schema: "1.0",
|
|
10
|
-
sources: [
|
|
11
|
-
"https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly",
|
|
12
|
-
"https://firefox-source-docs.mozilla.org/devtools-user/keyboard_shortcuts/index.html",
|
|
13
|
-
"https://support.google.com/chrome/answer/157179",
|
|
14
|
-
"https://developer.chrome.com/docs/devtools/shortcuts",
|
|
15
|
-
"https://support.apple.com/guide/safari/keyboard-shortcuts-and-gestures-cpsh003/mac",
|
|
16
|
-
"https://developer.apple.com/documentation/safari-developer-tools/web-inspector",
|
|
17
|
-
"https://support.microsoft.com/en-us/microsoft-edge/keyboard-shortcuts-in-microsoft-edge-50d3edab-30d9-c7e4-21ce-37fe2713cfad",
|
|
18
|
-
"https://support.apple.com/en-us/102650",
|
|
19
|
-
"https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec",
|
|
20
|
-
"https://help.gnome.org/gnome-help/shell-keyboard-shortcuts.html"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
severityLevels: {
|
|
24
|
-
hard: "Browser or OS intercepts before page-world keydown fires. preventDefault() can't recover it.",
|
|
25
|
-
"find-bar-only": "Reserved only when the browser's find bar has focus. Fires in page world during normal browsing.",
|
|
26
|
-
"menu-activation": "Win/Linux Alt+letter activates the browser menu bar. Hard to suppress reliably.",
|
|
27
|
-
"system-text": "Only reserved while a text input has focus (terminal-style cursor controls on macOS).",
|
|
28
|
-
compose: "macOS Option+letter types a special character in text inputs. Outside inputs, free for page world.",
|
|
29
|
-
os: "Operating system intercepts globally, before any application sees it.",
|
|
30
|
-
"devtools-open": "Only relevant when DevTools is already open; outside DevTools it fires normally.",
|
|
31
|
-
preventable: "The browser's own shortcut, but keydown reaches the page first: a binding with preventDefault() keeps the browser out, and without one the browser acts. Checked with real keys on Windows (docs/notes/key-check-reserved-2026-10-29.md)."
|
|
32
|
-
},
|
|
33
|
-
$keyFormat: "Each combo key uses hotkey-router-compatible syntax: modifiers in canonical order (ctrl|meta|alt|shift) joined by '+', then the key (lowercased letter, or symbolic name). Per-platform tables use the platform's native modifier name \u2014 `meta` on macOS = Cmd, `meta` on Windows = Win, `ctrl` on Linux/Windows = the primary modifier.",
|
|
34
|
-
platforms: {
|
|
35
|
-
mac: {
|
|
36
|
-
browsers: {
|
|
37
|
-
firefox: {
|
|
38
|
-
"meta+a": { action: "Select all", severity: "hard" },
|
|
39
|
-
"meta+b": { action: "Bookmarks sidebar", severity: "hard" },
|
|
40
|
-
"meta+c": { action: "Copy", severity: "hard" },
|
|
41
|
-
"meta+d": { action: "Bookmark this page", severity: "hard" },
|
|
42
|
-
"meta+e": { action: "Search from page", severity: "hard" },
|
|
43
|
-
"meta+f": { action: "Find in page", severity: "hard" },
|
|
44
|
-
"meta+g": { action: "Find next", severity: "hard" },
|
|
45
|
-
"meta+j": { action: "Downloads", severity: "hard" },
|
|
46
|
-
"meta+l": { action: "Focus address bar", severity: "hard" },
|
|
47
|
-
"meta+n": { action: "New window", severity: "hard" },
|
|
48
|
-
"meta+o": { action: "Open file", severity: "hard" },
|
|
49
|
-
"meta+p": { action: "Print", severity: "hard" },
|
|
50
|
-
"meta+r": { action: "Reload", severity: "hard" },
|
|
51
|
-
"meta+s": { action: "Save page", severity: "hard" },
|
|
52
|
-
"meta+t": { action: "New tab", severity: "hard" },
|
|
53
|
-
"meta+u": { action: "View source", severity: "hard" },
|
|
54
|
-
"meta+v": { action: "Paste", severity: "hard" },
|
|
55
|
-
"meta+w": { action: "Close tab", severity: "hard" },
|
|
56
|
-
"meta+x": { action: "Cut", severity: "hard" },
|
|
57
|
-
"meta+y": { action: "Redo", severity: "hard" },
|
|
58
|
-
"meta+z": { action: "Undo", severity: "hard" },
|
|
59
|
-
"meta+shift+a": { action: "Add-ons manager", severity: "hard" },
|
|
60
|
-
"meta+shift+b": { action: "Bookmarks toolbar", severity: "hard" },
|
|
61
|
-
"meta+shift+c": { action: "Inspector (element picker)", severity: "hard" },
|
|
62
|
-
"meta+shift+d": { action: "Bookmark all tabs", severity: "hard" },
|
|
63
|
-
"meta+shift+e": { action: "Network Monitor", severity: "hard" },
|
|
64
|
-
"meta+shift+f": { action: "Toggle fullscreen", severity: "hard" },
|
|
65
|
-
"meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
66
|
-
"meta+shift+j": { action: "Browser Console", severity: "hard" },
|
|
67
|
-
"meta+shift+n": { action: "New private window", severity: "hard" },
|
|
68
|
-
"meta+shift+o": { action: "Bookmarks library", severity: "hard" },
|
|
69
|
-
"meta+shift+p": { action: "New private window (alt)", severity: "hard" },
|
|
70
|
-
"meta+shift+q": { action: "Quit (with confirm)", severity: "hard" },
|
|
71
|
-
"meta+shift+s": { action: "Firefox Screenshot", severity: "hard" },
|
|
72
|
-
"meta+shift+t": { action: "Reopen closed tab", severity: "hard" },
|
|
73
|
-
"meta+shift+v": { action: "Paste as plain text", severity: "hard" },
|
|
74
|
-
"meta+shift+w": { action: "Close window", severity: "hard" },
|
|
75
|
-
"meta+shift+z": { action: "Redo", severity: "hard" },
|
|
76
|
-
"meta+alt+c": { action: "Inspector", severity: "hard" },
|
|
77
|
-
"meta+alt+e": { action: "Network Monitor", severity: "hard" },
|
|
78
|
-
"meta+alt+i": { action: "DevTools Toolbox", severity: "hard" },
|
|
79
|
-
"meta+alt+j": { action: "Browser Console", severity: "hard" },
|
|
80
|
-
"meta+alt+k": { action: "Web Console", severity: "hard" },
|
|
81
|
-
"meta+alt+m": { action: "Responsive Design Mode", severity: "hard" },
|
|
82
|
-
"meta+alt+z": { action: "Debugger", severity: "hard" }
|
|
83
|
-
},
|
|
84
|
-
chrome: {
|
|
85
|
-
"meta+a": { action: "Select all", severity: "hard" },
|
|
86
|
-
"meta+c": { action: "Copy", severity: "hard" },
|
|
87
|
-
"meta+d": { action: "Bookmark this page", severity: "hard" },
|
|
88
|
-
"meta+e": { action: "Search selected text", severity: "find-bar-only" },
|
|
89
|
-
"meta+f": { action: "Find in page", severity: "hard" },
|
|
90
|
-
"meta+g": { action: "Find next", severity: "hard" },
|
|
91
|
-
"meta+l": { action: "Focus address bar", severity: "hard" },
|
|
92
|
-
"meta+n": { action: "New window", severity: "hard" },
|
|
93
|
-
"meta+o": { action: "Open file", severity: "hard" },
|
|
94
|
-
"meta+p": { action: "Print", severity: "hard" },
|
|
95
|
-
"meta+r": { action: "Reload", severity: "hard" },
|
|
96
|
-
"meta+s": { action: "Save page", severity: "hard" },
|
|
97
|
-
"meta+t": { action: "New tab", severity: "hard" },
|
|
98
|
-
"meta+v": { action: "Paste", severity: "hard" },
|
|
99
|
-
"meta+w": { action: "Close tab", severity: "hard" },
|
|
100
|
-
"meta+x": { action: "Cut", severity: "hard" },
|
|
101
|
-
"meta+y": { action: "History page", severity: "hard" },
|
|
102
|
-
"meta+z": { action: "Undo", severity: "hard" },
|
|
103
|
-
"meta+shift+b": { action: "Bookmarks bar toggle", severity: "hard" },
|
|
104
|
-
"meta+shift+c": { action: "DevTools Inspector", severity: "hard" },
|
|
105
|
-
"meta+shift+d": { action: "Bookmark all tabs", severity: "hard" },
|
|
106
|
-
"meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
107
|
-
"meta+shift+j": { action: "Downloads page", severity: "hard" },
|
|
108
|
-
"meta+shift+m": { action: "Switch user / guest", severity: "hard" },
|
|
109
|
-
"meta+shift+n": { action: "New incognito window", severity: "hard" },
|
|
110
|
-
"meta+shift+r": { action: "Hard reload", severity: "hard" },
|
|
111
|
-
"meta+shift+t": { action: "Reopen closed tab", severity: "hard" },
|
|
112
|
-
"meta+shift+v": { action: "Paste as plain text", severity: "hard" },
|
|
113
|
-
"meta+shift+w": { action: "Close window", severity: "hard" },
|
|
114
|
-
"meta+shift+z": { action: "Redo", severity: "hard" },
|
|
115
|
-
"meta+alt+i": { action: "DevTools", severity: "hard" },
|
|
116
|
-
"meta+alt+j": { action: "DevTools (console)", severity: "hard" },
|
|
117
|
-
"meta+alt+u": { action: "View source", severity: "hard" }
|
|
118
|
-
},
|
|
119
|
-
safari: {
|
|
120
|
-
"meta+a": { action: "Select all", severity: "hard" },
|
|
121
|
-
"meta+c": { action: "Copy", severity: "hard" },
|
|
122
|
-
"meta+d": { action: "Add to Reading List", severity: "hard" },
|
|
123
|
-
"meta+f": { action: "Find in page", severity: "hard" },
|
|
124
|
-
"meta+g": { action: "Find next", severity: "hard" },
|
|
125
|
-
"meta+j": { action: "Downloads", severity: "hard" },
|
|
126
|
-
"meta+l": { action: "Focus Smart Search", severity: "hard" },
|
|
127
|
-
"meta+n": { action: "New window", severity: "hard" },
|
|
128
|
-
"meta+p": { action: "Print", severity: "hard" },
|
|
129
|
-
"meta+r": { action: "Reload", severity: "hard" },
|
|
130
|
-
"meta+s": { action: "Save page", severity: "hard" },
|
|
131
|
-
"meta+t": { action: "New tab", severity: "hard" },
|
|
132
|
-
"meta+v": { action: "Paste", severity: "hard" },
|
|
133
|
-
"meta+w": { action: "Close tab", severity: "hard" },
|
|
134
|
-
"meta+x": { action: "Cut", severity: "hard" },
|
|
135
|
-
"meta+z": { action: "Undo", severity: "hard" },
|
|
136
|
-
"meta+shift+c": { action: "Inspector pick element", severity: "hard" },
|
|
137
|
-
"meta+shift+d": { action: "Add Reading List item", severity: "hard" },
|
|
138
|
-
"meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
139
|
-
"meta+shift+h": { action: "Go to homepage", severity: "hard" },
|
|
140
|
-
"meta+shift+n": { action: "New private window", severity: "hard" },
|
|
141
|
-
"meta+shift+r": { action: "Reader mode", severity: "hard" },
|
|
142
|
-
"meta+shift+t": { action: "Reopen last closed tab", severity: "hard" },
|
|
143
|
-
"meta+shift+v": { action: "Paste as plain text", severity: "hard" },
|
|
144
|
-
"meta+shift+w": { action: "Close window", severity: "hard" },
|
|
145
|
-
"meta+shift+z": { action: "Redo", severity: "hard" },
|
|
146
|
-
"meta+alt+c": { action: "Web Inspector pick", severity: "hard" },
|
|
147
|
-
"meta+alt+i": { action: "Web Inspector", severity: "hard" }
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
system: {
|
|
151
|
-
"meta+space": { action: "Spotlight", severity: "os" },
|
|
152
|
-
"meta+tab": { action: "App switcher", severity: "os" },
|
|
153
|
-
"meta+h": { action: "Hide app", severity: "os" },
|
|
154
|
-
"meta+m": { action: "Minimize window", severity: "os" },
|
|
155
|
-
"meta+q": { action: "Quit app", severity: "os" },
|
|
156
|
-
"meta+shift+3": { action: "Screenshot full screen", severity: "os" },
|
|
157
|
-
"meta+shift+4": { action: "Screenshot selection", severity: "os" },
|
|
158
|
-
"meta+shift+5": { action: "Screen recording tool", severity: "os" },
|
|
159
|
-
"meta+shift+q": { action: "Log out", severity: "os" },
|
|
160
|
-
"meta+ctrl+q": { action: "Lock screen", severity: "os" },
|
|
161
|
-
"meta+ctrl+space": { action: "Character Viewer", severity: "os" },
|
|
162
|
-
"meta+alt+esc": { action: "Force-quit dialog", severity: "os" },
|
|
163
|
-
"meta+shift+slash": { action: "Help menu search (Cmd+?)", severity: "os" },
|
|
164
|
-
"meta+alt+h": { action: "Hide other apps", severity: "os" },
|
|
165
|
-
"meta+alt+d": { action: "Show or hide the Dock", severity: "os" },
|
|
166
|
-
"meta+backquote": { action: "Switch windows of the front app", severity: "os" }
|
|
167
|
-
},
|
|
168
|
-
noteForLetterCombos: {
|
|
169
|
-
"alt+a..z": { behavior: "compose", note: "Option+letter types special characters in text inputs (Option+E\u2192\xB4, Option+A\u2192\xE5, Option+F\u2192\u0192). Outside inputs, free for page world." },
|
|
170
|
-
"ctrl+a..z": { behavior: "system-text", note: "Mac uses Ctrl+letter as terminal-style cursor controls inside text inputs (Ctrl+A=line start, Ctrl+E=line end, Ctrl+K=delete-to-end, etc.). Outside inputs, free for page world." }
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
windows: {
|
|
174
|
-
browsers: {
|
|
175
|
-
firefox: {
|
|
176
|
-
"ctrl+a": { action: "Select all", severity: "preventable" },
|
|
177
|
-
"ctrl+b": { action: "Bookmarks sidebar", severity: "preventable" },
|
|
178
|
-
"ctrl+c": { action: "Copy", severity: "preventable" },
|
|
179
|
-
"ctrl+d": { action: "Bookmark this page", severity: "preventable" },
|
|
180
|
-
"ctrl+e": { action: "Search from page", severity: "preventable" },
|
|
181
|
-
"ctrl+f": { action: "Find in page", severity: "preventable" },
|
|
182
|
-
"ctrl+g": { action: "Find next", severity: "preventable" },
|
|
183
|
-
"ctrl+h": { action: "History sidebar", severity: "preventable" },
|
|
184
|
-
"ctrl+j": { action: "Downloads", severity: "preventable" },
|
|
185
|
-
"ctrl+k": { action: "Search from page", severity: "preventable" },
|
|
186
|
-
"ctrl+l": { action: "Focus address bar", severity: "preventable" },
|
|
187
|
-
"ctrl+n": { action: "New window", severity: "hard" },
|
|
188
|
-
"ctrl+o": { action: "Open file", severity: "preventable" },
|
|
189
|
-
"ctrl+p": { action: "Print", severity: "preventable" },
|
|
190
|
-
"ctrl+r": { action: "Reload", severity: "preventable" },
|
|
191
|
-
"ctrl+s": { action: "Save page", severity: "preventable" },
|
|
192
|
-
"ctrl+t": { action: "New tab", severity: "hard" },
|
|
193
|
-
"ctrl+u": { action: "View source", severity: "preventable" },
|
|
194
|
-
"ctrl+v": { action: "Paste", severity: "preventable" },
|
|
195
|
-
"ctrl+w": { action: "Close tab", severity: "hard" },
|
|
196
|
-
"ctrl+x": { action: "Cut", severity: "preventable" },
|
|
197
|
-
"ctrl+y": { action: "Redo", severity: "preventable" },
|
|
198
|
-
"ctrl+z": { action: "Undo", severity: "preventable" },
|
|
199
|
-
"ctrl+shift+a": { action: "Add-ons manager", severity: "hard" },
|
|
200
|
-
"ctrl+shift+b": { action: "Bookmarks toolbar", severity: "hard" },
|
|
201
|
-
"ctrl+shift+c": { action: "Inspector (element picker)", severity: "hard" },
|
|
202
|
-
"ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" },
|
|
203
|
-
"ctrl+shift+e": { action: "Network Monitor", severity: "hard" },
|
|
204
|
-
"ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
205
|
-
"ctrl+shift+i": { action: "Developer Tools", severity: "hard" },
|
|
206
|
-
"ctrl+shift+j": { action: "Browser Console", severity: "hard" },
|
|
207
|
-
"ctrl+shift+k": { action: "Web Console", severity: "hard" },
|
|
208
|
-
"ctrl+shift+m": { action: "Responsive Design Mode", severity: "hard" },
|
|
209
|
-
"ctrl+shift+n": { action: "New private window", severity: "hard" },
|
|
210
|
-
"ctrl+shift+o": { action: "Bookmarks library", severity: "hard" },
|
|
211
|
-
"ctrl+shift+p": { action: "New private window (alt)", severity: "hard" },
|
|
212
|
-
"ctrl+shift+s": { action: "Firefox Screenshot", severity: "hard" },
|
|
213
|
-
"ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
|
|
214
|
-
"ctrl+shift+v": { action: "Paste as plain text", severity: "hard" },
|
|
215
|
-
"ctrl+shift+w": { action: "Close window", severity: "hard" },
|
|
216
|
-
"ctrl+shift+y": { action: "Downloads (alt)", severity: "hard" },
|
|
217
|
-
"ctrl+shift+z": { action: "Debugger", severity: "hard" },
|
|
218
|
-
"alt+f": { action: "File menu", severity: "menu-activation" },
|
|
219
|
-
"alt+e": { action: "Edit menu", severity: "menu-activation" },
|
|
220
|
-
"alt+v": { action: "View menu", severity: "menu-activation" },
|
|
221
|
-
"alt+b": { action: "Bookmarks menu", severity: "menu-activation" },
|
|
222
|
-
"alt+t": { action: "Tools menu", severity: "menu-activation" },
|
|
223
|
-
"alt+h": { action: "Help menu", severity: "menu-activation" },
|
|
224
|
-
"alt+d": { action: "Focus address bar", severity: "hard" }
|
|
225
|
-
},
|
|
226
|
-
chrome: {
|
|
227
|
-
"ctrl+a": { action: "Select all", severity: "preventable" },
|
|
228
|
-
"ctrl+c": { action: "Copy", severity: "preventable" },
|
|
229
|
-
"ctrl+d": { action: "Bookmark this page", severity: "preventable" },
|
|
230
|
-
"ctrl+e": { action: "Search from page", severity: "preventable" },
|
|
231
|
-
"ctrl+f": { action: "Find in page", severity: "preventable" },
|
|
232
|
-
"ctrl+g": { action: "Find next", severity: "preventable" },
|
|
233
|
-
"ctrl+h": { action: "History page", severity: "preventable" },
|
|
234
|
-
"ctrl+j": { action: "Downloads", severity: "preventable" },
|
|
235
|
-
"ctrl+k": { action: "Search from page", severity: "preventable" },
|
|
236
|
-
"ctrl+l": { action: "Focus address bar", severity: "preventable" },
|
|
237
|
-
"ctrl+n": { action: "New window", severity: "hard" },
|
|
238
|
-
"ctrl+o": { action: "Open file", severity: "preventable" },
|
|
239
|
-
"ctrl+p": { action: "Print", severity: "preventable" },
|
|
240
|
-
"ctrl+r": { action: "Reload", severity: "preventable" },
|
|
241
|
-
"ctrl+s": { action: "Save page", severity: "preventable" },
|
|
242
|
-
"ctrl+t": { action: "New tab", severity: "hard" },
|
|
243
|
-
"ctrl+u": { action: "View source", severity: "preventable" },
|
|
244
|
-
"ctrl+v": { action: "Paste", severity: "preventable" },
|
|
245
|
-
"ctrl+w": { action: "Close tab", severity: "hard" },
|
|
246
|
-
"ctrl+x": { action: "Cut", severity: "preventable" },
|
|
247
|
-
"ctrl+z": { action: "Undo", severity: "preventable" },
|
|
248
|
-
"ctrl+shift+b": { action: "Bookmarks bar toggle", severity: "hard" },
|
|
249
|
-
"ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" },
|
|
250
|
-
"ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
251
|
-
"ctrl+shift+i": { action: "DevTools", severity: "hard" },
|
|
252
|
-
"ctrl+shift+j": { action: "DevTools (console)", severity: "hard" },
|
|
253
|
-
"ctrl+shift+m": { action: "Switch user / guest", severity: "hard" },
|
|
254
|
-
"ctrl+shift+n": { action: "Incognito window", severity: "hard" },
|
|
255
|
-
"ctrl+shift+r": { action: "Hard reload", severity: "hard" },
|
|
256
|
-
"ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
|
|
257
|
-
"ctrl+shift+v": { action: "Paste as plain text", severity: "hard" },
|
|
258
|
-
"ctrl+shift+w": { action: "Close window", severity: "hard" },
|
|
259
|
-
"alt+d": { action: "Focus address bar", severity: "hard" },
|
|
260
|
-
"alt+e": { action: "Customize menu", severity: "menu-activation" },
|
|
261
|
-
"alt+f": { action: "Customize menu (alt)", severity: "menu-activation" }
|
|
262
|
-
},
|
|
263
|
-
edge: {
|
|
264
|
-
"ctrl+a": { action: "Select all", severity: "preventable" },
|
|
265
|
-
"ctrl+c": { action: "Copy", severity: "preventable" },
|
|
266
|
-
"ctrl+d": { action: "Favorite this page", severity: "preventable" },
|
|
267
|
-
"ctrl+e": { action: "Search from page", severity: "preventable" },
|
|
268
|
-
"ctrl+f": { action: "Find in page", severity: "preventable" },
|
|
269
|
-
"ctrl+g": { action: "Find next", severity: "preventable" },
|
|
270
|
-
"ctrl+h": { action: "History", severity: "preventable" },
|
|
271
|
-
"ctrl+j": { action: "Downloads", severity: "preventable" },
|
|
272
|
-
"ctrl+k": { action: "Search from page", severity: "preventable" },
|
|
273
|
-
"ctrl+l": { action: "Focus address bar", severity: "preventable" },
|
|
274
|
-
"ctrl+m": { action: "Mute current tab", severity: "preventable" },
|
|
275
|
-
"ctrl+n": { action: "New window", severity: "hard" },
|
|
276
|
-
"ctrl+o": { action: "Open file", severity: "preventable" },
|
|
277
|
-
"ctrl+p": { action: "Print", severity: "preventable" },
|
|
278
|
-
"ctrl+r": { action: "Reload", severity: "preventable" },
|
|
279
|
-
"ctrl+s": { action: "Save page", severity: "preventable" },
|
|
280
|
-
"ctrl+t": { action: "New tab", severity: "hard" },
|
|
281
|
-
"ctrl+u": { action: "View source", severity: "preventable" },
|
|
282
|
-
"ctrl+v": { action: "Paste", severity: "preventable" },
|
|
283
|
-
"ctrl+w": { action: "Close tab", severity: "hard" },
|
|
284
|
-
"ctrl+x": { action: "Cut", severity: "preventable" },
|
|
285
|
-
"ctrl+z": { action: "Undo", severity: "preventable" },
|
|
286
|
-
"ctrl+shift+b": { action: "Favorites bar toggle", severity: "hard" },
|
|
287
|
-
"ctrl+shift+d": { action: "Bookmark all tabs in folder", severity: "hard" },
|
|
288
|
-
"ctrl+shift+e": { action: "Search in sidebar", severity: "hard" },
|
|
289
|
-
"ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
|
|
290
|
-
"ctrl+shift+i": { action: "DevTools", severity: "hard" },
|
|
291
|
-
"ctrl+shift+j": { action: "DevTools (console)", severity: "hard" },
|
|
292
|
-
"ctrl+shift+k": { action: "Duplicate tab", severity: "hard" },
|
|
293
|
-
"ctrl+shift+l": { action: "Paste and search", severity: "hard" },
|
|
294
|
-
"ctrl+shift+m": { action: "Switch user / guest", severity: "hard" },
|
|
295
|
-
"ctrl+shift+n": { action: "InPrivate window", severity: "hard" },
|
|
296
|
-
"ctrl+shift+o": { action: "Open favorites", severity: "hard" },
|
|
297
|
-
"ctrl+shift+p": { action: "Print (system dialog)", severity: "hard" },
|
|
298
|
-
"ctrl+shift+r": { action: "Hard reload", severity: "hard" },
|
|
299
|
-
"ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
|
|
300
|
-
"ctrl+shift+u": { action: "Read Aloud toggle", severity: "hard" },
|
|
301
|
-
"ctrl+shift+v": { action: "Paste without formatting", severity: "hard" },
|
|
302
|
-
"ctrl+shift+w": { action: "Close window", severity: "hard" },
|
|
303
|
-
"ctrl+shift+y": { action: "Collections", severity: "hard" },
|
|
304
|
-
"alt+d": { action: "Focus address bar", severity: "hard" },
|
|
305
|
-
"alt+e": { action: "Settings menu", severity: "menu-activation" },
|
|
306
|
-
"alt+f": { action: "Settings menu (alt)", severity: "menu-activation" },
|
|
307
|
-
"alt+shift+b": { action: "Focus favorites bar", severity: "hard" },
|
|
308
|
-
"alt+shift+i": { action: "Send feedback dialog", severity: "hard" },
|
|
309
|
-
"alt+shift+t": { action: "Focus app bar toolbar", severity: "hard" }
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
system: {
|
|
313
|
-
"meta+a": { action: "Action Center", severity: "os" },
|
|
314
|
-
"meta+c": { action: "Windows search", severity: "os" },
|
|
315
|
-
"meta+d": { action: "Show desktop", severity: "os" },
|
|
316
|
-
"meta+e": { action: "File Explorer", severity: "os" },
|
|
317
|
-
"meta+g": { action: "Game bar", severity: "os" },
|
|
318
|
-
"meta+h": { action: "Voice dictation", severity: "os" },
|
|
319
|
-
"meta+i": { action: "Settings", severity: "os" },
|
|
320
|
-
"meta+l": { action: "Lock", severity: "os" },
|
|
321
|
-
"meta+n": { action: "Notification center", severity: "os" },
|
|
322
|
-
"meta+p": { action: "Project / display mode", severity: "os" },
|
|
323
|
-
"meta+r": { action: "Run dialog", severity: "os" },
|
|
324
|
-
"meta+s": { action: "Search", severity: "os" },
|
|
325
|
-
"meta+v": { action: "Clipboard history", severity: "os" },
|
|
326
|
-
"meta+w": { action: "Widgets", severity: "os" },
|
|
327
|
-
"meta+x": { action: "Quick Link menu", severity: "os" },
|
|
328
|
-
"meta+z": { action: "Snap layouts", severity: "os" },
|
|
329
|
-
"meta+tab": { action: "Task View", severity: "os" },
|
|
330
|
-
"meta+shift+s": { action: "Screenshot region", severity: "os" },
|
|
331
|
-
"ctrl+shift+esc": { action: "Task Manager", severity: "os" },
|
|
332
|
-
"ctrl+alt+del": { action: "Security screen", severity: "os" },
|
|
333
|
-
"alt+tab": { action: "Switch windows", severity: "os" },
|
|
334
|
-
"alt+f4": { action: "Close active window", severity: "os" }
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
linux: {
|
|
338
|
-
browsers: {
|
|
339
|
-
firefox: "$ref:platforms.windows.browsers.firefox",
|
|
340
|
-
chrome: "$ref:platforms.windows.browsers.chrome",
|
|
341
|
-
edge: "$ref:platforms.windows.browsers.edge"
|
|
342
|
-
},
|
|
343
|
-
system: {
|
|
344
|
-
$comment: "GNOME defaults. KDE and other DEs have similar-shaped reservations but vary; this is a conservative baseline.",
|
|
345
|
-
"meta+tab": { action: "Switch windows", severity: "os" },
|
|
346
|
-
"meta+a": { action: "Show applications", severity: "os" },
|
|
347
|
-
"meta+l": { action: "Lock screen", severity: "os" },
|
|
348
|
-
"meta+v": { action: "Notification list", severity: "os" },
|
|
349
|
-
"alt+tab": { action: "Switch applications", severity: "os" },
|
|
350
|
-
"alt+esc": { action: "Cycle windows", severity: "os" },
|
|
351
|
-
"alt+f2": { action: "Run command", severity: "os" },
|
|
352
|
-
"alt+f4": { action: "Close window", severity: "os" },
|
|
353
|
-
"ctrl+alt+tab": { action: "Top-bar accessibility switcher", severity: "os" },
|
|
354
|
-
"ctrl+alt+del": { action: "Power-off dialog", severity: "os" },
|
|
355
|
-
"ctrl+shift+alt+r": { action: "Toggle screencast recording", severity: "os" }
|
|
356
|
-
},
|
|
357
|
-
noteForCtrlAlt: "Some Linux setups map right-Alt (AltGr) to 'compose' for typing accented characters, in which case AltGr+letter is reported as ctrl+alt+letter and types a special character. Avoid the ctrl+alt+letter namespace on Linux."
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
// platform.js
|
|
363
|
-
function fromPlatformString(s) {
|
|
364
|
-
if (!s) return null;
|
|
365
|
-
if (/Chrome ?OS|CrOS/i.test(s)) return "chromeos";
|
|
366
|
-
if (/Mac|iPhone|iPad|iPod/i.test(s)) return "mac";
|
|
367
|
-
if (/Win/i.test(s)) return "windows";
|
|
368
|
-
if (/Linux|X11/i.test(s)) return "linux";
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
function detectPlatform(nav = typeof navigator !== "undefined" ? navigator : null, { chromeos = false } = {}) {
|
|
372
|
-
if (!nav) return null;
|
|
373
|
-
const ua = nav.userAgent || "";
|
|
374
|
-
const found = (/\bCrOS\b/.test(ua) ? "chromeos" : null) || fromPlatformString(nav.userAgentData?.platform) || fromPlatformString(nav.platform) || (/Mac OS X/i.test(ua) ? "mac" : /Windows/i.test(ua) ? "windows" : /Linux|X11/i.test(ua) ? "linux" : null);
|
|
375
|
-
if (found === "chromeos" && !chromeos) return "linux";
|
|
376
|
-
return found;
|
|
377
|
-
}
|
|
378
|
-
function detectBrowser(nav = typeof navigator !== "undefined" ? navigator : null) {
|
|
379
|
-
if (!nav) return null;
|
|
380
|
-
const ua = nav.userAgent || "";
|
|
381
|
-
if (/Edg\//.test(ua)) return "edge";
|
|
382
|
-
if (/Firefox/.test(ua)) return "firefox";
|
|
383
|
-
if (/Chrome/.test(ua)) return "chrome";
|
|
384
|
-
if (/Safari/.test(ua)) return "safari";
|
|
385
|
-
return null;
|
|
386
|
-
}
|
|
387
|
-
var PLATFORM_LABELS = { mac: "macOS", windows: "Windows", linux: "Linux", chromeos: "ChromeOS" };
|
|
388
|
-
function platformLabel(platform) {
|
|
389
|
-
return PLATFORM_LABELS[platform] || platform;
|
|
390
|
-
}
|
|
4
|
+
// reservations.js
|
|
5
|
+
import { ownValue } from "./lookup.js";
|
|
391
6
|
|
|
392
|
-
//
|
|
393
|
-
var DEFAULT_PLATFORM = detectPlatform();
|
|
394
|
-
var keyAliases = Object.freeze({
|
|
395
|
-
// common
|
|
396
|
-
esc: "escape",
|
|
397
|
-
escape: "escape",
|
|
398
|
-
space: " ",
|
|
399
|
-
spacebar: " ",
|
|
400
|
-
enter: "enter",
|
|
401
|
-
return: "enter",
|
|
402
|
-
del: "delete",
|
|
403
|
-
delete: "delete",
|
|
404
|
-
backspace: "backspace",
|
|
405
|
-
tab: "tab",
|
|
406
|
-
// arrows
|
|
407
|
-
up: "arrowup",
|
|
408
|
-
down: "arrowdown",
|
|
409
|
-
left: "arrowleft",
|
|
410
|
-
right: "arrowright",
|
|
411
|
-
// navigation
|
|
412
|
-
home: "home",
|
|
413
|
-
end: "end",
|
|
414
|
-
pageup: "pageup",
|
|
415
|
-
pagedown: "pagedown",
|
|
416
|
-
pgup: "pageup",
|
|
417
|
-
pgdn: "pagedown",
|
|
418
|
-
// modifiers (words)
|
|
419
|
-
cmd: "meta",
|
|
420
|
-
command: "meta",
|
|
421
|
-
win: "meta",
|
|
422
|
-
meta: "meta",
|
|
423
|
-
control: "ctrl",
|
|
424
|
-
ctrl: "ctrl",
|
|
425
|
-
option: "alt",
|
|
426
|
-
opt: "alt",
|
|
427
|
-
alt: "alt",
|
|
428
|
-
shift: "shift",
|
|
429
|
-
// modifiers (symbols)
|
|
430
|
-
"\u2318": "meta",
|
|
431
|
-
"\u2303": "ctrl",
|
|
432
|
-
"\u2325": "alt",
|
|
433
|
-
"\u21E7": "shift",
|
|
434
|
-
// cross-platform "mod", resolved per platform while parsing
|
|
435
|
-
mod: "mod",
|
|
436
|
-
// plus key ergonomics
|
|
437
|
-
plus: "+"
|
|
438
|
-
});
|
|
439
|
-
function normalizeKey(key) {
|
|
440
|
-
const original = String(key ?? "");
|
|
441
|
-
if (original === " ") return " ";
|
|
442
|
-
const trimmed = original.trim();
|
|
443
|
-
const k = trimmed.toLowerCase();
|
|
444
|
-
return keyAliases[k] ?? k;
|
|
445
|
-
}
|
|
446
|
-
var PUNCT_NAMES = {
|
|
447
|
-
".": "period",
|
|
448
|
-
",": "comma",
|
|
449
|
-
";": "semicolon",
|
|
450
|
-
"'": "quote",
|
|
451
|
-
"/": "slash",
|
|
452
|
-
"\\": "backslash",
|
|
453
|
-
"[": "bracketleft",
|
|
454
|
-
"]": "bracketright",
|
|
455
|
-
"-": "minus",
|
|
456
|
-
"=": "equal",
|
|
457
|
-
"`": "backquote",
|
|
458
|
-
" ": "space",
|
|
459
|
-
"+": "equal"
|
|
460
|
-
};
|
|
461
|
-
function codeToBase(code) {
|
|
462
|
-
if (!code) return null;
|
|
463
|
-
const letter = /^Key([A-Za-z])$/.exec(code);
|
|
464
|
-
if (letter) return letter[1].toLowerCase();
|
|
465
|
-
const digit = /^(?:Digit|Numpad)(\d)$/.exec(code);
|
|
466
|
-
if (digit) return digit[1];
|
|
467
|
-
return code.toLowerCase();
|
|
468
|
-
}
|
|
469
|
-
function keyToBase(key) {
|
|
470
|
-
if (key == null || key === "") return null;
|
|
471
|
-
if (PUNCT_NAMES[key]) return PUNCT_NAMES[key];
|
|
472
|
-
const k = normalizeKey(key);
|
|
473
|
-
return PUNCT_NAMES[k] || k || null;
|
|
474
|
-
}
|
|
475
|
-
function lookupKey(combo) {
|
|
476
|
-
if (!combo || combo.bareModifier) return null;
|
|
477
|
-
const base = combo.code ? codeToBase(combo.code) : keyToBase(combo.key);
|
|
478
|
-
if (!base) return null;
|
|
479
|
-
const parts = [];
|
|
480
|
-
if (combo.ctrl) parts.push("ctrl");
|
|
481
|
-
if (combo.meta) parts.push("meta");
|
|
482
|
-
if (combo.alt) parts.push("alt");
|
|
483
|
-
if (combo.shift) parts.push("shift");
|
|
484
|
-
parts.push(base);
|
|
485
|
-
return parts.join("+");
|
|
486
|
-
}
|
|
7
|
+
// data/browser-hotkeys.json
|
|
8
|
+
var browser_hotkeys_default = { version: { generated: "2026-10-29", schema: "1.0" }, platforms: { mac: { browsers: { firefox: { "meta+a": { action: "Select all", severity: "hard" }, "meta+b": { action: "Bookmarks sidebar", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Bookmark this page", severity: "hard" }, "meta+e": { action: "Search from page", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+j": { action: "Downloads", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+u": { action: "View source", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "Redo", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+a": { action: "Add-ons manager", severity: "hard" }, "meta+shift+b": { action: "Bookmarks toolbar", severity: "hard" }, "meta+shift+c": { action: "Inspector (element picker)", severity: "hard" }, "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "meta+shift+e": { action: "Network Monitor", severity: "hard" }, "meta+shift+f": { action: "Toggle fullscreen", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+j": { action: "Browser Console", severity: "hard" }, "meta+shift+n": { action: "New private window", severity: "hard" }, "meta+shift+o": { action: "Bookmarks library", severity: "hard" }, "meta+shift+p": { action: "New private window (alt)", severity: "hard" }, "meta+shift+q": { action: "Quit (with confirm)", severity: "hard" }, "meta+shift+s": { action: "Firefox Screenshot", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+c": { action: "Inspector", severity: "hard" }, "meta+alt+e": { action: "Network Monitor", severity: "hard" }, "meta+alt+i": { action: "DevTools Toolbox", severity: "hard" }, "meta+alt+j": { action: "Browser Console", severity: "hard" }, "meta+alt+k": { action: "Web Console", severity: "hard" }, "meta+alt+m": { action: "Responsive Design Mode", severity: "hard" }, "meta+alt+z": { action: "Debugger", severity: "hard" } }, chrome: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Bookmark this page", severity: "hard" }, "meta+e": { action: "Search selected text", severity: "find-bar-only" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "History page", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+b": { action: "Bookmarks bar toggle", severity: "hard" }, "meta+shift+c": { action: "DevTools Inspector", severity: "hard" }, "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+j": { action: "Downloads page", severity: "hard" }, "meta+shift+m": { action: "Switch user / guest", severity: "hard" }, "meta+shift+n": { action: "New incognito window", severity: "hard" }, "meta+shift+r": { action: "Hard reload", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+i": { action: "DevTools", severity: "hard" }, "meta+alt+j": { action: "DevTools (console)", severity: "hard" }, "meta+alt+u": { action: "View source", severity: "hard" } }, safari: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Add to Reading List", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+j": { action: "Downloads", severity: "hard" }, "meta+l": { action: "Focus Smart Search", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+c": { action: "Inspector pick element", severity: "hard" }, "meta+shift+d": { action: "Add Reading List item", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+h": { action: "Go to homepage", severity: "hard" }, "meta+shift+n": { action: "New private window", severity: "hard" }, "meta+shift+r": { action: "Reader mode", severity: "hard" }, "meta+shift+t": { action: "Reopen last closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+c": { action: "Web Inspector pick", severity: "hard" }, "meta+alt+i": { action: "Web Inspector", severity: "hard" } }, edge: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Save as favorite", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "History", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "ctrl+m": { action: "Mute current tab", severity: "hard" }, "ctrl+meta+f": { action: "Toggle full screen", severity: "hard" }, "meta+shift+b": { action: "Favorites bar toggle", severity: "hard" }, "meta+shift+c": { action: "Developer tools", severity: "hard" }, "meta+shift+d": { action: "Favorite all tabs", severity: "hard" }, "meta+shift+e": { action: "Search in sidebar", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+h": { action: "Home page", severity: "hard" }, "meta+shift+m": { action: "Switch user / guest", severity: "hard" }, "meta+shift+n": { action: "New InPrivate window", severity: "hard" }, "meta+shift+r": { action: "Hard reload", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+u": { action: "Read Aloud toggle", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+f": { action: "Search the web", severity: "hard" }, "meta+alt+j": { action: "JavaScript console", severity: "hard" }, "meta+alt+l": { action: "Downloads", severity: "hard" }, "meta+alt+m": { action: "Minimize all windows", severity: "hard" } } }, system: { "meta+space": { action: "Spotlight", severity: "os" }, "meta+tab": { action: "App switcher", severity: "os" }, "meta+h": { action: "Hide app", severity: "os" }, "meta+m": { action: "Minimize window", severity: "os" }, "meta+q": { action: "Quit app", severity: "os" }, "meta+shift+3": { action: "Screenshot full screen", severity: "os" }, "meta+shift+4": { action: "Screenshot selection", severity: "os" }, "meta+shift+5": { action: "Screen recording tool", severity: "os" }, "meta+shift+q": { action: "Log out", severity: "os" }, "meta+ctrl+q": { action: "Lock screen", severity: "os" }, "meta+ctrl+space": { action: "Character Viewer", severity: "os" }, "meta+alt+esc": { action: "Force-quit dialog", severity: "os" }, "meta+shift+slash": { action: "Help menu search (Cmd+?)", severity: "os" }, "meta+alt+h": { action: "Hide other apps", severity: "os" }, "meta+alt+d": { action: "Show or hide the Dock", severity: "os" }, "meta+backquote": { action: "Switch windows of the front app", severity: "os" } } }, windows: { browsers: { firefox: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+b": { action: "Bookmarks sidebar", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Bookmark this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History sidebar", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+y": { action: "Redo", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+a": { action: "Add-ons manager", severity: "hard" }, "ctrl+shift+b": { action: "Bookmarks toolbar", severity: "hard" }, "ctrl+shift+c": { action: "Inspector (element picker)", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "ctrl+shift+e": { action: "Network Monitor", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "Developer Tools", severity: "hard" }, "ctrl+shift+j": { action: "Browser Console", severity: "hard" }, "ctrl+shift+k": { action: "Web Console", severity: "hard" }, "ctrl+shift+m": { action: "Responsive Design Mode", severity: "hard" }, "ctrl+shift+n": { action: "New private window", severity: "hard" }, "ctrl+shift+o": { action: "Bookmarks library", severity: "hard" }, "ctrl+shift+p": { action: "New private window (alt)", severity: "hard" }, "ctrl+shift+s": { action: "Firefox Screenshot", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "ctrl+shift+y": { action: "Downloads (alt)", severity: "hard" }, "ctrl+shift+z": { action: "Debugger", severity: "hard" }, "alt+f": { action: "File menu", severity: "menu-activation" }, "alt+e": { action: "Edit menu", severity: "menu-activation" }, "alt+v": { action: "View menu", severity: "menu-activation" }, "alt+b": { action: "Bookmarks menu", severity: "menu-activation" }, "alt+t": { action: "Tools menu", severity: "menu-activation" }, "alt+h": { action: "Help menu", severity: "menu-activation" }, "alt+d": { action: "Focus address bar", severity: "hard" } }, chrome: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Bookmark this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History page", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+b": { action: "Bookmarks bar toggle", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "DevTools", severity: "hard" }, "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" }, "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" }, "ctrl+shift+n": { action: "Incognito window", severity: "hard" }, "ctrl+shift+r": { action: "Hard reload", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "alt+d": { action: "Focus address bar", severity: "hard" }, "alt+e": { action: "Customize menu", severity: "menu-activation" }, "alt+f": { action: "Customize menu (alt)", severity: "menu-activation" } }, edge: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Favorite this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+m": { action: "Mute current tab", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+b": { action: "Favorites bar toggle", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs in folder", severity: "hard" }, "ctrl+shift+e": { action: "Search in sidebar", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "DevTools", severity: "hard" }, "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" }, "ctrl+shift+k": { action: "Duplicate tab", severity: "hard" }, "ctrl+shift+l": { action: "Paste and search", severity: "hard" }, "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" }, "ctrl+shift+n": { action: "InPrivate window", severity: "hard" }, "ctrl+shift+o": { action: "Open favorites", severity: "hard" }, "ctrl+shift+p": { action: "Print (system dialog)", severity: "hard" }, "ctrl+shift+r": { action: "Hard reload", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+u": { action: "Read Aloud toggle", severity: "hard" }, "ctrl+shift+v": { action: "Paste without formatting", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "ctrl+shift+y": { action: "Collections", severity: "hard" }, "alt+d": { action: "Focus address bar", severity: "hard" }, "alt+e": { action: "Settings menu", severity: "menu-activation" }, "alt+f": { action: "Settings menu (alt)", severity: "menu-activation" }, "alt+shift+b": { action: "Focus favorites bar", severity: "hard" }, "alt+shift+i": { action: "Send feedback dialog", severity: "hard" }, "alt+shift+t": { action: "Focus app bar toolbar", severity: "hard" } } }, system: { "meta+a": { action: "Action Center", severity: "os" }, "meta+c": { action: "Windows search", severity: "os" }, "meta+d": { action: "Show desktop", severity: "os" }, "meta+e": { action: "File Explorer", severity: "os" }, "meta+g": { action: "Game bar", severity: "os" }, "meta+h": { action: "Voice dictation", severity: "os" }, "meta+i": { action: "Settings", severity: "os" }, "meta+l": { action: "Lock", severity: "os" }, "meta+n": { action: "Notification center", severity: "os" }, "meta+p": { action: "Project / display mode", severity: "os" }, "meta+r": { action: "Run dialog", severity: "os" }, "meta+s": { action: "Search", severity: "os" }, "meta+v": { action: "Clipboard history", severity: "os" }, "meta+w": { action: "Widgets", severity: "os" }, "meta+x": { action: "Quick Link menu", severity: "os" }, "meta+z": { action: "Snap layouts", severity: "os" }, "meta+tab": { action: "Task View", severity: "os" }, "meta+shift+s": { action: "Screenshot region", severity: "os" }, "ctrl+shift+esc": { action: "Task Manager", severity: "os" }, "ctrl+alt+del": { action: "Security screen", severity: "os" }, "alt+tab": { action: "Switch windows", severity: "os" }, "alt+f4": { action: "Close active window", severity: "os" } } }, linux: { browsers: { firefox: "$ref:platforms.windows.browsers.firefox", chrome: "$ref:platforms.windows.browsers.chrome", edge: "$ref:platforms.windows.browsers.edge" }, system: { "meta+tab": { action: "Switch windows", severity: "os" }, "meta+a": { action: "Show applications", severity: "os" }, "meta+l": { action: "Lock screen", severity: "os" }, "meta+v": { action: "Notification list", severity: "os" }, "alt+tab": { action: "Switch applications", severity: "os" }, "alt+esc": { action: "Cycle windows", severity: "os" }, "alt+f2": { action: "Run command", severity: "os" }, "alt+f4": { action: "Close window", severity: "os" }, "ctrl+alt+tab": { action: "Top-bar accessibility switcher", severity: "os" }, "ctrl+alt+del": { action: "Power-off dialog", severity: "os" }, "ctrl+shift+alt+r": { action: "Toggle screencast recording", severity: "os" } } } } };
|
|
487
9
|
|
|
488
10
|
// reservations.js
|
|
11
|
+
import { lookupKey, readHotkey } from "./parse.js";
|
|
12
|
+
import { detectPlatform, detectBrowser } from "./platform.js";
|
|
489
13
|
var SUPPORTED_SCHEMA = "1.0";
|
|
490
14
|
var HARD_SEVERITIES = /* @__PURE__ */ new Set(["hard", "os", "menu-activation"]);
|
|
491
15
|
var SOFT_SEVERITIES = /* @__PURE__ */ new Set(["find-bar-only", "compose", "system-text", "devtools-open", "preventable"]);
|
|
492
16
|
function canonicalize(rawKey) {
|
|
493
|
-
|
|
494
|
-
if (!parts.length) return "";
|
|
495
|
-
const base = parts[parts.length - 1];
|
|
496
|
-
const mods = new Set(parts.slice(0, -1));
|
|
497
|
-
const out = [];
|
|
498
|
-
if (mods.has("ctrl")) out.push("ctrl");
|
|
499
|
-
if (mods.has("meta")) out.push("meta");
|
|
500
|
-
if (mods.has("alt")) out.push("alt");
|
|
501
|
-
if (mods.has("shift")) out.push("shift");
|
|
502
|
-
out.push(base);
|
|
503
|
-
return out.join("+");
|
|
17
|
+
return lookupKey(readHotkey(rawKey).combo) || "";
|
|
504
18
|
}
|
|
505
19
|
function resolveRef(value, root) {
|
|
506
20
|
if (typeof value !== "string" || !value.startsWith("$ref:")) return value;
|
|
@@ -519,10 +33,10 @@ function normalizeTable(table) {
|
|
|
519
33
|
return out;
|
|
520
34
|
}
|
|
521
35
|
function buildIndex(data) {
|
|
522
|
-
const idx = { platforms:
|
|
36
|
+
const idx = { platforms: /* @__PURE__ */ Object.create(null) };
|
|
523
37
|
const platforms = data?.platforms || {};
|
|
524
38
|
for (const [platform, pdata] of Object.entries(platforms)) {
|
|
525
|
-
const browsers =
|
|
39
|
+
const browsers = /* @__PURE__ */ Object.create(null);
|
|
526
40
|
for (const [name, btable] of Object.entries(pdata.browsers || {})) {
|
|
527
41
|
browsers[name] = normalizeTable(resolveRef(btable, data));
|
|
528
42
|
}
|
|
@@ -534,16 +48,16 @@ function buildIndex(data) {
|
|
|
534
48
|
return idx;
|
|
535
49
|
}
|
|
536
50
|
var SCHEMA_OK = browser_hotkeys_default?.version?.schema === SUPPORTED_SCHEMA;
|
|
537
|
-
var INDEX = SCHEMA_OK ? buildIndex(browser_hotkeys_default) : { platforms:
|
|
51
|
+
var INDEX = SCHEMA_OK ? buildIndex(browser_hotkeys_default) : { platforms: /* @__PURE__ */ Object.create(null) };
|
|
538
52
|
var lookupKeyFromCombo = lookupKey;
|
|
539
53
|
function lookupReservation(combo, { platform, browser } = {}) {
|
|
540
54
|
if (!SCHEMA_OK) return null;
|
|
541
55
|
const lookupKey2 = lookupKeyFromCombo(combo);
|
|
542
56
|
if (!lookupKey2) return null;
|
|
543
|
-
const pdata = platform && INDEX.platforms
|
|
57
|
+
const pdata = platform && ownValue(INDEX.platforms, platform);
|
|
544
58
|
if (!pdata) return null;
|
|
545
|
-
const btable = browser ? pdata.browsers
|
|
546
|
-
const bclaim = btable
|
|
59
|
+
const btable = browser ? ownValue(pdata.browsers, browser) : null;
|
|
60
|
+
const bclaim = ownValue(btable, lookupKey2);
|
|
547
61
|
if (bclaim) {
|
|
548
62
|
return {
|
|
549
63
|
source: "browser",
|
|
@@ -554,7 +68,7 @@ function lookupReservation(combo, { platform, browser } = {}) {
|
|
|
554
68
|
severity: bclaim.severity
|
|
555
69
|
};
|
|
556
70
|
}
|
|
557
|
-
const sclaim = pdata.system
|
|
71
|
+
const sclaim = ownValue(pdata.system, lookupKey2);
|
|
558
72
|
if (sclaim) {
|
|
559
73
|
return {
|
|
560
74
|
source: "system",
|
|
@@ -573,45 +87,15 @@ function severityIsHard(severity) {
|
|
|
573
87
|
function severityIsSoft(severity) {
|
|
574
88
|
return SOFT_SEVERITIES.has(severity);
|
|
575
89
|
}
|
|
576
|
-
function formatReservationWarning(reservation, rawHotkey, bindOptions) {
|
|
577
|
-
const where = platformLabel(reservation.platform);
|
|
578
|
-
const sourceLabel = reservation.source === "browser" ? `${reservation.browser} on ${where}` : where;
|
|
579
|
-
const tag = severityIsHard(reservation.severity) ? "will not fire" : reservation.severity === "preventable" ? bindOptions?.preventDefault ? "fires first; preventDefault keeps the browser out" : "fires, and the browser acts too; bind with preventDefault: true" : "fires in normal browsing";
|
|
580
|
-
return `[hotkey-router] "${rawHotkey}" (${reservation.lookupKey}) reserved by ${sourceLabel}: "${reservation.action}" [${reservation.severity}] \u2014 ${tag}.`;
|
|
581
|
-
}
|
|
582
|
-
function emitReservationWarning(reservation, rawHotkey, console_ = console, bindOptions) {
|
|
583
|
-
const msg = formatReservationWarning(reservation, rawHotkey, bindOptions);
|
|
584
|
-
const loud = severityIsHard(reservation.severity) || reservation.severity === "preventable" && !bindOptions?.preventDefault;
|
|
585
|
-
const fn = loud ? console_.warn : console_.info;
|
|
586
|
-
fn.call(console_, msg);
|
|
587
|
-
}
|
|
588
|
-
function installReservationWarnings(hotkeys, opts = {}) {
|
|
589
|
-
if (!hotkeys || typeof hotkeys.onBind !== "function") {
|
|
590
|
-
throw new TypeError(
|
|
591
|
-
"installReservationWarnings(hotkeys) requires a hotkey-router instance with onBind() (>= v0.2.0)"
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
const platform = opts.platform !== void 0 ? opts.platform : detectPlatform();
|
|
595
|
-
const browser = opts.browser !== void 0 ? opts.browser : detectBrowser();
|
|
596
|
-
const console_ = opts.console || console;
|
|
597
|
-
return hotkeys.onBind(({ combo, raw, options }) => {
|
|
598
|
-
if (options?.warnOnReserved === false) return;
|
|
599
|
-
if (!platform || !browser) return;
|
|
600
|
-
const reservation = lookupReservation(combo, { platform, browser });
|
|
601
|
-
if (reservation) emitReservationWarning(reservation, raw, console_, options);
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
90
|
var SCHEMA_VERSION = browser_hotkeys_default?.version?.schema;
|
|
605
91
|
var DATA_GENERATED = browser_hotkeys_default?.version?.generated;
|
|
92
|
+
var BUNDLED_DATA = browser_hotkeys_default;
|
|
606
93
|
export {
|
|
607
94
|
DATA_GENERATED,
|
|
608
|
-
|
|
95
|
+
BUNDLED_DATA as HOTKEY_DATA,
|
|
609
96
|
SCHEMA_VERSION,
|
|
610
97
|
detectBrowser,
|
|
611
98
|
detectPlatform,
|
|
612
|
-
emitReservationWarning,
|
|
613
|
-
formatReservationWarning,
|
|
614
|
-
installReservationWarnings,
|
|
615
99
|
lookupKeyFromCombo,
|
|
616
100
|
lookupReservation,
|
|
617
101
|
severityIsHard,
|