Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/app/view/term/term.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down