quick hack to try to reserve some alt keys from the terminal (#915)

This commit is contained in:
Mike Sawka 2024-09-30 21:48:02 -07:00 committed by GitHub
parent 95e129d94e
commit 72e24900f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ import { waveEventSubscribe } from "@/app/store/wps";
import { RpcApi } from "@/app/store/wshclientapi";
import { WindowRpcClient } from "@/app/store/wshrpcutil";
import { VDomView } from "@/app/view/term/vdom";
import { WOS, atoms, getConnStatusAtom, globalStore, useSettingsPrefixAtom } from "@/store/global";
import { PLATFORM, WOS, atoms, getConnStatusAtom, globalStore, useSettingsPrefixAtom } from "@/store/global";
import * as services from "@/store/services";
import * as keyutil from "@/util/keyutil";
import * as util from "@/util/util";
@ -313,6 +313,14 @@ const TerminalView = ({ blockId, model }: TerminalViewProps) => {
prtn.catch((e) => console.log("error controller resync (enter)", blockId, e));
return false;
}
if (PLATFORM == "win32" || PLATFORM == "linux") {
const reservedAltKeys = ["Alt:t", "Alt:n", "Alt:w", "Alt:m", "Alt:g", "Alt:[", "Alt:]", "Alt:Shift:r"];
for (let i = 0; i < reservedAltKeys.length; i++) {
if (keyutil.checkKeyPressed(waveEvent, reservedAltKeys[i])) {
return false;
}
}
}
return true;
}
const fullConfig = globalStore.get(atoms.fullConfigAtom);