From 46b7c0325168f7ca6bb1835a780c6acdb289325e Mon Sep 17 00:00:00 2001 From: Jacob I <24721341+jisham318@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:46:15 -0600 Subject: [PATCH 1/2] add support for mouse button 3 (middle mouse) --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 85549a3..06f5e21 100644 --- a/src/types.ts +++ b/src/types.ts @@ -73,7 +73,7 @@ export namespace Clack { /** * Represents `Enum.UserInputType` mouse buttons. */ - export type MouseButton = Enum.UserInputType.MouseButton1 | Enum.UserInputType.MouseButton2; + export type MouseButton = Enum.UserInputType.MouseButton1 | Enum.UserInputType.MouseButton2 | Enum.UserInputType.MouseButton3; /** Enum representing the user's preferred input type. */ export const enum InputType { From d6e414efe7277c2c4132dfb6219e8f7a023f9026 Mon Sep 17 00:00:00 2001 From: Jacob I <24721341+jisham318@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:51:41 -0600 Subject: [PATCH 2/2] i forgot to add checks for button3 --- src/mouse.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mouse.ts b/src/mouse.ts index 94118c6..a0641dd 100644 --- a/src/mouse.ts +++ b/src/mouse.ts @@ -26,7 +26,8 @@ export class Mouse { if (processed) return; if ( input.UserInputType === Enum.UserInputType.MouseButton1 || - input.UserInputType === Enum.UserInputType.MouseButton2 + input.UserInputType === Enum.UserInputType.MouseButton2 || + input.UserInputType === Enum.UserInputType.MouseButton3 ) { const signal = this.mouseDownSignals.get(input.UserInputType); if (signal) { @@ -40,7 +41,8 @@ export class Mouse { if (processed) return; if ( input.UserInputType === Enum.UserInputType.MouseButton1 || - input.UserInputType === Enum.UserInputType.MouseButton2 + input.UserInputType === Enum.UserInputType.MouseButton2 || + input.UserInputType === Enum.UserInputType.MouseButton3 ) { const signal = this.mouseUpSignals.get(input.UserInputType); if (signal) {