From 214ea67b76a9cf8ac97b2b8fc8c469c254dc6143 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 20 Jan 2026 09:08:11 +0000 Subject: [PATCH] add gamepad-bindings for escape key --- shell/glfw-gamepad.sml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/glfw-gamepad.sml b/shell/glfw-gamepad.sml index a6a2e83..a4f96bf 100644 --- a/shell/glfw-gamepad.sml +++ b/shell/glfw-gamepad.sml @@ -219,9 +219,16 @@ struct else if !(#l1Pressed state) then () else - let val () = InputMailbox.append KEY_BACKSPACE + let val () = InputMailbox.append InputMsg.KEY_BACKSPACE in #l1Pressed state := true end + + val () = + (* if l2 and r2 are both pressed, then send escape event *) + if l2 > 0.3 andalso r2 > 0.3 then + InputMailbox.append InputMsg.KEY_ESC + else + () in () end