From c31403445e7ea875c6f4e49d7da87220c1a10ccd Mon Sep 17 00:00:00 2001 From: SeeLook <seelook@gmail.com> Date: Tue, 11 Feb 2025 13:01:22 +0100 Subject: [PATCH] Piano: fixed JS --- src/qml/instruments/Piano.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qml/instruments/Piano.qml b/src/qml/instruments/Piano.qml index b8e6cc70..64e27f51 100644 --- a/src/qml/instruments/Piano.qml +++ b/src/qml/instruments/Piano.qml @@ -21,7 +21,9 @@ TpianoBg { width: Math.max(nootkaWindow.width, GLOB.instrument.getItemHeight(nootkaWindow.shortEdge) * 6.7) height: GLOB.instrument.getItemHeight(nootkaWindow.shortEdge) - onWantKeyToSelect: selectKey(k > -1 ? (isWhite ? whiteRep.itemAt(k) : whiteRep.itemAt(k).black) : null) + onWantKeyToSelect: (k, isWhite) => { + selectKey(k > -1 ? (isWhite ? whiteRep.itemAt(k) : whiteRep.itemAt(k).black) : null); + } transformOrigin: Item.TopLeft onCorrectInstrument: { if (!correctAnim) @@ -87,8 +89,8 @@ TpianoBg { PianoKeyWhite { nr: index - onEntered: activeKey = key - onClicked: selectedKey = key + onEntered: key => { activeKey = key; } + onClicked: key => { selectedKey = key; } } } -- GitLab