Skip to content

Commit 8829bee

Browse files
committed
Fix keypad buttons not resetting their fixed state on physical key events
After right clicking a keypad button to fix it, pressing and releasing the corresponding physical keyboard key would release the keypad button but keep fixed invisibly set.
1 parent 040cff6 commit 8829bee

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

qml/NButton.qml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Rectangle {
88
property alias text: label.text
99
property bool active: pressed || mouseArea.containsMouse
1010
property bool pressed: false
11+
// Pressing the right mouse button "locks" the button in enabled state
12+
property bool fixed: false
1113
property int keymap_id: 1
1214

1315
signal clicked()
@@ -21,6 +23,9 @@ Rectangle {
2123
if(pressed)
2224
clicked();
2325

26+
if(!pressed)
27+
fixed = false;
28+
2429
Emu.setButtonState(keymap_id, pressed);
2530
}
2631

@@ -81,9 +86,6 @@ Rectangle {
8186

8287
enabled: !multiMouseArea.mouseEnabled
8388

84-
// Pressing the right mouse button "locks" the button in enabled state
85-
property bool fixed: false
86-
8789
preventStealing: true
8890

8991
anchors.centerIn: parent

0 commit comments

Comments
 (0)