Merge pull request #2055 from hexnaught/s-key-editor-save-patch

Change editor save keybind to be CTRL/CMD + S
This commit is contained in:
hydroflame 2021-12-20 01:50:05 -05:00 committed by GitHub
commit 7215e73f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -277,9 +277,11 @@ export function Root(props: IProps): React.ReactElement {
useEffect(() => { useEffect(() => {
function maybeSave(event: KeyboardEvent): void { function maybeSave(event: KeyboardEvent): void {
if (Settings.DisableHotkeys) return; if (Settings.DisableHotkeys) return;
//Ctrl + b
if (event.keyCode == 66 && (event.ctrlKey || event.metaKey)) { // CTRL/CMD + S
if (event.code == `KeyS` && (event.ctrlKey || event.metaKey)) {
event.preventDefault(); event.preventDefault();
event.stopPropagation();
save(); save();
} }
} }
@ -622,7 +624,7 @@ export function Root(props: IProps): React.ReactElement {
<Typography color={updatingRam ? "secondary" : "primary"} sx={{ mx: 1 }}> <Typography color={updatingRam ? "secondary" : "primary"} sx={{ mx: 1 }}>
{ram} {ram}
</Typography> </Typography>
<Button onClick={save}>Save (Ctrl/Cmd + b)</Button> <Button onClick={save}>Save (CTRL/CMD + S)</Button>
<Typography sx={{ mx: 1 }}> <Typography sx={{ mx: 1 }}>
{" "} {" "}
Documentation:{" "} Documentation:{" "}