mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-31 18:37:34 +01:00
refactor(keybinds): change editor save keybind S
We need to stop the event from bubbling up to the browser and opening a 'save html' window to keep support in the browser, other than that, straight forward change to swap keybinding to 'S' for saving in the editor. Resolves danielyxie/bitburner#2053
This commit is contained in:
parent
82f6bbee13
commit
6ec7fcb9fa
@ -277,9 +277,11 @@ export function Root(props: IProps): React.ReactElement {
|
||||
useEffect(() => {
|
||||
function maybeSave(event: KeyboardEvent): void {
|
||||
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.stopPropagation();
|
||||
save();
|
||||
}
|
||||
}
|
||||
@ -622,7 +624,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
<Typography color={updatingRam ? "secondary" : "primary"} sx={{ mx: 1 }}>
|
||||
{ram}
|
||||
</Typography>
|
||||
<Button onClick={save}>Save (Ctrl/Cmd + b)</Button>
|
||||
<Button onClick={save}>Save (CTRL/CMD + S)</Button>
|
||||
<Typography sx={{ mx: 1 }}>
|
||||
{" "}
|
||||
Documentation:{" "}
|
||||
|
Loading…
Reference in New Issue
Block a user