2024-05-11 07:04:36 -04:00
|
|
|
<script>
|
2024-05-12 10:51:04 -04:00
|
|
|
var e = new KeyboardEvent('keydown', { cancelable: true, key: "Enter" });
|
2024-05-11 07:04:36 -04:00
|
|
|
|
|
|
|
console.error('keyboardEvent.html');
|
|
|
|
console.assert(e.cancelable, 'cancelable true');
|
|
|
|
console.assert(!e.defaultPrevented, 'false');
|
|
|
|
e.preventDefault();
|
|
|
|
console.assert(e.defaultPrevented, 'true');
|
2024-05-12 10:51:04 -04:00
|
|
|
console.assert(e.type === 'keydown', 'keydown');
|
2024-05-12 07:17:15 -04:00
|
|
|
console.assert(e.key === 'Enter', 'key Enter');
|
|
|
|
console.assert(e.keyCode === 13, 'ENTER = 13');
|
2024-05-12 10:51:04 -04:00
|
|
|
|
|
|
|
var e = new KeyboardEvent('keydown', { cancelable: true, key: "F12" });
|
|
|
|
console.assert(e.keyCode === 123, e.keyCode);
|
|
|
|
|
2024-06-01 07:30:03 -04:00
|
|
|
console.exit();
|
2024-05-11 07:04:36 -04:00
|
|
|
</script>
|