From 8da737150eea4a466cfd3f8ccfe6361d8bb776c1 Mon Sep 17 00:00:00 2001 From: Jage9 Date: Sun, 22 Feb 2026 17:16:31 -0500 Subject: [PATCH] Remap use/speak keys and update help/changelog --- client/public/changelog.json | 4 ++- client/public/help.json | 6 ++-- client/public/version.js | 2 +- client/src/input/mainCommandRouter.ts | 6 ++-- client/src/main.ts | 47 +++++++++++++-------------- 5 files changed, 34 insertions(+), 31 deletions(-) diff --git a/client/public/changelog.json b/client/public/changelog.json index 59c02c7..37ba0e5 100644 --- a/client/public/changelog.json +++ b/client/public/changelog.json @@ -5,7 +5,9 @@ "items": [ "Added support for Dropbox links and HTTP streams for item sounds and radio stations.", "You will no longer repeatedly hit walls.", - "Added user volume control and calibration." + "Added user volume control and calibration.", + "Added up/down arrows and page up/page down for numeric field adjustment.", + "Moved Use item to Enter Key instead of u, moved speak users to U from Shift U." ] }, { diff --git a/client/public/help.json b/client/public/help.json index f180281..3adb94c 100644 --- a/client/public/help.json +++ b/client/public/help.json @@ -33,7 +33,7 @@ "description": "List users; Enter teleports to that user" }, { - "keys": "Shift+U", + "keys": "U", "description": "Speak connected users" }, { @@ -82,7 +82,7 @@ "description": "Delete item" }, { - "keys": "U", + "keys": "Enter", "description": "Use item" } ] @@ -132,7 +132,7 @@ }, { "keys": "V", - "description": "Set microphone gain" + "description": "Set mic volume" }, { "keys": "Shift+V", diff --git a/client/public/version.js b/client/public/version.js index 38f75bf..a0744d9 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.22 R156"; +window.CHGRID_WEB_VERSION = "2026.02.22 R157"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/input/mainCommandRouter.ts b/client/src/input/mainCommandRouter.ts index cbcd2a4..a0fe1b8 100644 --- a/client/src/input/mainCommandRouter.ts +++ b/client/src/input/mainCommandRouter.ts @@ -16,7 +16,8 @@ export type MainModeCommand = | 'speakCoordinates' | 'openMicGainEdit' | 'calibrateMicrophone' - | 'useItemOrUsersSummary' + | 'useItem' + | 'speakUsers' | 'addItem' | 'locateOrListItems' | 'pickupDropOrDelete' @@ -46,7 +47,8 @@ export function resolveMainModeCommand(code: string, shiftKey: boolean): MainMod if (code === 'Minus' || code === 'NumpadSubtract') return 'effectValueDown'; if (code === 'KeyC') return 'speakCoordinates'; if (code === 'KeyV') return shiftKey ? 'calibrateMicrophone' : 'openMicGainEdit'; - if (code === 'KeyU') return 'useItemOrUsersSummary'; + if (code === 'Enter') return 'useItem'; + if (code === 'KeyU') return 'speakUsers'; if (code === 'KeyA') return 'addItem'; if (code === 'KeyI') return 'locateOrListItems'; if (code === 'KeyD') return 'pickupDropOrDelete'; diff --git a/client/src/main.ts b/client/src/main.ts index c50c578..3591eca 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1376,34 +1376,33 @@ function handleNormalModeInput(code: string, shiftKey: boolean): void { case 'calibrateMicrophone': void calibrateMicInputGain(); return; - case 'useItemOrUsersSummary': - if (shiftKey) { - const allUsers = [state.player.nickname, ...Array.from(state.peers.values()).map((p) => p.nickname)]; - const label = allUsers.length === 1 ? 'user' : 'users'; - updateStatus(`${allUsers.length} ${label}: ${allUsers.join(', ')}`); - audio.sfxUiBlip(); + case 'useItem': { + const carried = getCarriedItem(); + if (carried) { + useItem(carried); return; } - { - const carried = getCarriedItem(); - if (carried) { - useItem(carried); - return; - } - const squareItems = getItemsAtPosition(state.player.x, state.player.y); - const usable = squareItems.filter((item) => item.capabilities.includes('usable')); - if (usable.length === 0) { - updateStatus('No usable items here.'); - audio.sfxUiCancel(); - return; - } - if (usable.length === 1) { - useItem(usable[0]); - return; - } - beginItemSelection('use', usable); + const squareItems = getItemsAtPosition(state.player.x, state.player.y); + const usable = squareItems.filter((item) => item.capabilities.includes('usable')); + if (usable.length === 0) { + updateStatus('No usable items here.'); + audio.sfxUiCancel(); return; } + if (usable.length === 1) { + useItem(usable[0]); + return; + } + beginItemSelection('use', usable); + return; + } + case 'speakUsers': { + const allUsers = [state.player.nickname, ...Array.from(state.peers.values()).map((p) => p.nickname)]; + const label = allUsers.length === 1 ? 'user' : 'users'; + updateStatus(`${allUsers.length} ${label}: ${allUsers.join(', ')}`); + audio.sfxUiBlip(); + return; + } case 'addItem': { const itemTypeSequence = getItemTypeSequence(); if (itemTypeSequence.length === 0) {