2024-05-11 07:04:36 -04:00
|
|
|
<script>
|
2024-05-12 07:17:15 -04:00
|
|
|
var e = new KeyboardEvent('message', { 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');
|
|
|
|
console.assert(e.type === 'message', 'message');
|
2024-05-12 07:17:15 -04:00
|
|
|
console.assert(e.key === 'Enter', 'key Enter');
|
|
|
|
console.assert(e.keyCode === 13, 'ENTER = 13');
|
2024-05-11 07:04:36 -04:00
|
|
|
console.exit(0);
|
|
|
|
</script>
|