From 755d69675f38cb4a372259b2860dc671d00bd7ce Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 20 Jan 2026 08:02:14 +0000 Subject: [PATCH] fix how l1 and r1 buttons should be handled (previously, we weren't saving the relevant state to true when they were pressed, but now we are) --- shell/glfw-gamepad.sml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/shell/glfw-gamepad.sml b/shell/glfw-gamepad.sml index 46ce0fb..b15a96c 100644 --- a/shell/glfw-gamepad.sml +++ b/shell/glfw-gamepad.sml @@ -148,14 +148,24 @@ struct else handleTrianglePressed (xAxis, yAxis) val () = - if r1Pressed = 0 then #r1Pressed state := false - else if !(#r1Pressed state) then () - else InputMailbox.append (CHAR_EVENT #" ") + if r1Pressed = 0 then + #r1Pressed state := false + else if !(#r1Pressed state) then + () + else + let val () = InputMailbox.append (CHAR_EVENT #" ") + in #r1Pressed state := true + end val () = - if l1Pressed = 0 then #l1Pressed state := false - else if !(#l1Pressed state) then () - else InputMailbox.append KEY_BACKSPACE + if l1Pressed = 0 then + #l1Pressed state := false + else if !(#l1Pressed state) then + () + else + let val () = InputMailbox.append KEY_BACKSPACE + in #l1Pressed state := false + end in () end