Prevent shortcut reset collisions

This commit is contained in:
Gabriel Brown
2026-08-18 01:47:51 -04:00
parent 787d2b121a
commit b3b8e0d66d
3 changed files with 61 additions and 6 deletions
+10 -2
View File
@@ -13,9 +13,16 @@ ShellRoot {
return Keybinds.rebind(current, next);
}
function resetBind(current: string): void { Keybinds.resetBind(current); }
function resetBind(current: string): bool { return Keybinds.resetBind(current); }
function resetAll(): void { Keybinds.resetAll(); }
function seedResetCollision(shipped: string, current: string, occupantShipped: string): void {
const overrides = {};
overrides[shipped] = current;
overrides[occupantShipped] = shipped;
DesktopPreferences.set("keybindOverrides", overrides);
}
function chordFor(description: string): string {
const found = Keybinds.binds.find(bind => bind.description === description);
return found ? found.luaChord : "";
@@ -24,7 +31,8 @@ ShellRoot {
function overrideState(): string {
return JSON.stringify({
overrides: Keybinds.overrides,
count: Object.keys(Keybinds.overrides).length
count: Object.keys(Keybinds.overrides).length,
lastError: Keybinds.lastError
});
}