Merge pull request #2193 from Frank-py/patch-2

Updated Terminal.tsx to add keypress event.
This commit is contained in:
hydroflame 2021-12-28 10:33:04 -05:00 committed by GitHub
commit 5aff5fc944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

@ -118,7 +118,7 @@ Inside the root of the repo run
`npm install` to install all the dependencies
`npm run start:dev` to launch the game in dev mode.
After that you can open any browser and naviguate to `localhost:8000` and play the game.
After that you can open any browser and navigate to `localhost:8000` and play the game.
Saving a file will reload the game automatically.
#### Submitting a Pull Request

@ -351,6 +351,11 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
modifyInput("deletewordbefore");
}
if (event.keyCode === KEY.D && event.altKey) {
event.preventDefault();
modifyInput("deletewordafter");
}
if (event.keyCode === KEY.U && event.ctrlKey) {
event.preventDefault();
modifyInput("clearbefore");
@ -360,9 +365,6 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
event.preventDefault();
modifyInput("clearafter");
}
// TODO AFTER THIS:
// alt + d deletes word after cursor
}
}