mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
18 lines
571 B
HTML
18 lines
571 B
HTML
<script>
|
|
var e = new KeyboardEvent('keydown', { cancelable: true, key: "Enter" });
|
|
|
|
console.error('keyboardEvent.html');
|
|
console.assert(e.cancelable, 'cancelable true');
|
|
console.assert(!e.defaultPrevented, 'false');
|
|
e.preventDefault();
|
|
console.assert(e.defaultPrevented, 'true');
|
|
console.assert(e.type === 'keydown', 'keydown');
|
|
console.assert(e.key === 'Enter', 'key Enter');
|
|
console.assert(e.keyCode === 13, 'ENTER = 13');
|
|
|
|
var e = new KeyboardEvent('keydown', { cancelable: true, key: "F12" });
|
|
console.assert(e.keyCode === 123, e.keyCode);
|
|
|
|
console.exit();
|
|
</script>
|