mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Prevent the default action when the Apple keyboard handles a key (#151)
Before, if the browser window wasn't tall enough to show the whole keyboard, using the arrow keys in the window would cause the page to move as well. Now all key events that are sent to the keyboard have `preventDefault()` called on them.
This commit is contained in:
parent
89cf6aa17b
commit
62568d19f4
@ -118,9 +118,7 @@ export const Keyboard = ({ apple2, e }: KeyboardProps) => {
|
||||
if (document.activeElement && document.activeElement !== document.body) {
|
||||
return;
|
||||
}
|
||||
if (event.key === ' ') {
|
||||
event.preventDefault();
|
||||
}
|
||||
event.preventDefault();
|
||||
const key = mapKeyEvent(event, active.includes('LOCK'));
|
||||
if (key !== 0xff) {
|
||||
// CTRL-SHIFT-DELETE for reset
|
||||
|
Loading…
x
Reference in New Issue
Block a user