diff --git a/client/public/help.json b/client/public/help.json index 88d5d98..750c6f7 100644 --- a/client/public/help.json +++ b/client/public/help.json @@ -87,7 +87,7 @@ }, { "keys": "Piano mode", - "description": "When using a piano: 1-9 (and 0 for the 10th slot) changes instrument, -/= changes octave, ASDFGHJKL;' plays C major notes, WETYUOP] plays sharps, comma starts/stops recording, period plays recording, slash stops playback, Escape exits" + "description": "When using a piano: 1-9 (and 0 for the 10th slot) changes instrument, -/= changes octave, ASDFGHJKL;' plays C major notes, WETYUOP] plays sharps, Z starts/stops recording, X plays recording, C stops playback, Escape exits" } ] }, diff --git a/client/public/version.js b/client/public/version.js index 1778e0d..99a29b1 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 R206"; +window.CHGRID_WEB_VERSION = "2026.02.22 R207"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/main.ts b/client/src/main.ts index a15d1aa..ab04ba5 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -2414,17 +2414,17 @@ function handlePianoUseModeInput(code: string): void { stopPianoUseMode(false); return; } - if (code === 'Comma') { + if (code === 'KeyZ') { signaling.send({ type: 'item_piano_recording', itemId, action: 'toggle_record' }); audio.sfxUiBlip(); return; } - if (code === 'Period') { + if (code === 'KeyX') { signaling.send({ type: 'item_piano_recording', itemId, action: 'playback' }); audio.sfxUiBlip(); return; } - if (code === 'Slash') { + if (code === 'KeyC') { signaling.send({ type: 'item_piano_recording', itemId, action: 'stop_playback' }); audio.sfxUiBlip(); return; diff --git a/client/src/network/messageHandlers.ts b/client/src/network/messageHandlers.ts index 97ac18b..d43067b 100644 --- a/client/src/network/messageHandlers.ts +++ b/client/src/network/messageHandlers.ts @@ -241,12 +241,18 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco } case 'item_action_result': { + const pianoStatusMessages = new Set([ + 'record', + 'play', + 'stop', + 'No recording saved on this piano.', + 'Stop recording before playback.', + 'This piano is already recording.', + ]); if (message.ok) { if (message.action === 'use') { - const pianoStatusLabel = - message.message === 'record' || message.message === 'play' || message.message === 'stop' ? message.message : null; - if (pianoStatusLabel) { - deps.updateStatus(pianoStatusLabel); + if (pianoStatusMessages.has(message.message)) { + deps.updateStatus(message.message); deps.audioUiBlip(); break; } @@ -260,6 +266,11 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco deps.audioUiConfirm(); } } else { + if (message.action === 'use' && pianoStatusMessages.has(message.message)) { + deps.updateStatus(message.message); + deps.audioUiCancel(); + break; + } deps.pushChatMessage(message.message); deps.audioUiCancel(); } diff --git a/docs/controls.md b/docs/controls.md index aa1f4b7..48ab30c 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -81,9 +81,9 @@ Applies to effect select, user/item list modes, item selection, item property li - `W E T Y U O P ]`: Play sharps - Multiple keys can be held/played at once - `-` / `=`: Shift octave down/up -- `,`: Start/stop recording on this piano (max 30s) -- `.`: Play back saved recording on this piano -- `/`: Stop playback on this piano +- `Z`: Start/stop recording on this piano (max 30s) +- `X`: Play back saved recording on this piano +- `C`: Stop playback on this piano - `Escape`: Exit piano mode ## Help Viewer Mode