Updated Terminal.tsx to add keypress event.

Added keypress event to delete the word after input by pressing "alt" + "d".
This commit is contained in:
Frank-py 2021-12-25 23:11:21 +01:00 committed by GitHub
parent d99b03d12e
commit 73adc71965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -350,7 +350,12 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
event.preventDefault();
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
}
}