mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 01:24:36 +00:00
Fix typos, mistake, and from PR 3677 a wrong test
This commit is contained in:
@@ -384,7 +384,8 @@ export class HelpModal extends BaseModal {
|
||||
<tr class="hover:bg-white/5 transition-colors">
|
||||
<td class="py-3 pl-4 border-b border-white/5">
|
||||
<div class="inline-flex items-center gap-2">
|
||||
${this.renderKey(keybinds.emojiMenuModifier)}
|
||||
${this.renderKey("Alt")}
|
||||
<!-- Listens to e.altKey, either AltLeft or AltRight -->
|
||||
<span class="text-white/40 font-bold">+</span>
|
||||
${this.renderKey(keybinds.resetGfx)}
|
||||
</div>
|
||||
|
||||
@@ -90,8 +90,9 @@ export class UserSettingModal extends BaseModal {
|
||||
const { action, value, prevValue } = e.detail;
|
||||
let { key } = e.detail;
|
||||
|
||||
// TODO: remove after testing
|
||||
console.info(
|
||||
"handleKeybindChange recieved value: " + value,
|
||||
"handleKeybindChange received value: " + value,
|
||||
", key: " + key,
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -380,7 +380,7 @@ export function formatKeyForDisplay(value: string): string {
|
||||
Backslash: "\\",
|
||||
Shift: "Shift ⇧",
|
||||
ShiftLeft: "Shift ⇧",
|
||||
ShiftRight: "Shift ⇧",
|
||||
ShiftRight: "⇧ Shift",
|
||||
Control: "Ctrl",
|
||||
// "Alt Gr" emits ControlLeft+Alt in Windows on many keyboard layouts and we catch the first code.
|
||||
// Is undiscernable normally from ControlLeft but user sees "alt gr" on the key so display it too
|
||||
@@ -389,7 +389,7 @@ export function formatKeyForDisplay(value: string): string {
|
||||
Alt: Platform.isMac ? "⌥" : "Alt",
|
||||
AltLeft: Platform.isMac ? "⌥" : "Alt",
|
||||
AltRight: Platform.isMac ? "⌥" : "Alt",
|
||||
Metat: Platform.isMac ? "⌘" : "⊞",
|
||||
Meta: Platform.isMac ? "⌘" : "⊞",
|
||||
MetaLeft: Platform.isMac ? "⌘" : "⊞", //"⊞" is Windows key, "⌘" is Command key on Mac
|
||||
MetaRight: Platform.isMac ? "⌘" : "⊞",
|
||||
Escape: "Esc", // Cannot be bound to action by user, but used as reserved key
|
||||
|
||||
@@ -909,11 +909,11 @@ describe("Warship box selection (Shift+drag)", () => {
|
||||
expect(mockCanvas.style.cursor).toBe("crosshair");
|
||||
});
|
||||
|
||||
test("ShiftRight keydown also sets cursor to crosshair", () => {
|
||||
test("ShiftRight keydown does not set cursor to crosshair", () => {
|
||||
// ShiftRight is not the default shiftKey keybind (ShiftLeft is).
|
||||
// This test verifies the configured shiftKey works, not a hardcoded ShiftRight.
|
||||
window.dispatchEvent(new KeyboardEvent("keydown", { code: "ShiftLeft" }));
|
||||
expect(mockCanvas.style.cursor).toBe("crosshair");
|
||||
window.dispatchEvent(new KeyboardEvent("keydown", { code: "ShiftRight" }));
|
||||
expect(mockCanvas.style.cursor).not.toBe("crosshair");
|
||||
});
|
||||
|
||||
test("Shift keyup resets cursor when no selection box active", () => {
|
||||
|
||||
Reference in New Issue
Block a user