Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keyboard

File: Rhapsodist/Core/Widgets/Keyboard.js · Namespace: Keyboard.

Overview

Keyboard drives the on-screen keyboard’s key colours from Manifest.keyranges, the current patch/articulation’s own key ranges, and the current transposition, keeping colouring aligned with the notes that will actually trigger a range.

Usage

Keyboard wires itself to fltKeyboard and starts colouring keys as soon as Core.js includes it, reacting to patch, articulation, and transpose changes on its own.

Look and Feel

fltKeyboard draws through a local Look and Feel, deferring to the project’s own LookAndFeel function first if one is defined.

FunctionDraws
drawWhiteNoteEach white key.
drawBlackNoteEach black key.

Public API

Thin wrappers over the fltKeyboard floating tile, usable by an expansion that needs to adjust keyboard display properties at runtime:

FunctionDescriptionReturns
setProperty(key: string, value: NotUndefined)Sets a fltKeyboard property directly.—
setDataProperty(key: string, value: NotUndefined)Writes a key in fltKeyboard’s Data JSON.—
getDataProperty(key: string)Reads a key from fltKeyboard’s Data JSON.NotUndefined

Internal Reference

FunctionDescriptionReturns
updateVisibleRange()Reads LowKey/HiKey from fltKeyboard’s Data into lowHiKey, used to round the low/high key’s outer corners.—
setKeyRanges()Applies every stored key range’s colour (Manifest, patch, and articulation ranges, adjusted for the current transposition) via Engine.setKeyColour.—
resetKeyColours()Resets every key to its inactive colour before setKeyRanges() re-applies the active ranges.—

Broadcasters

BroadcasterDescription
bcPatchChangedknbPatch’s value changes. Applies the new patch’s keyranges, if any, and re-colours the keyboard.
bcArticulationChangedknbArticulation’s value changes. Applies the new articulation’s keyranges, if any, and re-colours the keyboard.
bcTranposeChangedknbTranspose’s value changes. Updates the stored transposition and re-colours the keyboard against it.