-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
30 lines (27 loc) · 821 Bytes
/
test.html
File metadata and controls
30 lines (27 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Test ComboKeys</title>
</head>
<body>
<h1>测试 ComboKeys - Ctrl+Alt+Shift+A</h1>
<div id="log" style="font-family: monospace; padding: 20px; background: #222; color: #0f0; min-height: 200px;"></div>
<script type="module">
import { ComboKeys } from './dist/index.js';
const logEl = document.getElementById('log');
function log(msg) {
logEl.innerHTML += msg + '<br>';
console.log(msg);
}
const combo = new ComboKeys('Ctrl+Alt+Shift+A')
.debug(true)
.onTrigger((info) => {
log('🎯 TRIGGERED! Keys: ' + info.keys.join(' + '));
log('📋 Sequence: ' + info.sequence);
})
.start();
log('Ready - Press Ctrl+Alt+Shift+A');
</script>
</body>
</html>