From 5b58c732d1dade6f56ae45926a85d11f4d6b7415 Mon Sep 17 00:00:00 2001 From: Marcos Diaz Date: Thu, 13 Jun 2024 17:22:59 +0300 Subject: [PATCH] Fixed button normal mode incorrectly encoded when there were modifiers --- src/lib/ctrl.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/ctrl.ts b/src/lib/ctrl.ts index e7e8aae..d550f9e 100644 --- a/src/lib/ctrl.ts +++ b/src/lib/ctrl.ts @@ -437,9 +437,11 @@ export class CtrlButton extends CtrlSection { let mode = 0 if (this.hold) mode += ButtonMode.HOLD if (this.double) mode += ButtonMode.DOUBLE - if (this.immediate) mode += ButtonMode.IMMEDIATE - if (this.long) mode += ButtonMode.LONG - if (this.sticky) mode += ButtonMode.STICKY + if (this.hold || this.double) { + if (this.immediate) mode += ButtonMode.IMMEDIATE + if (this.long) mode += ButtonMode.LONG + } + if (this.sticky) mode = ButtonMode.STICKY if (mode === 0) mode = ButtonMode.NORMAL return mode }