From d19864947b6e8ea1049a56ca3d965691c51b4108 Mon Sep 17 00:00:00 2001 From: jussi Date: Sat, 18 Nov 2023 17:11:36 +0200 Subject: Joystick event. --- examples/events/main.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'examples/events/main.lua') diff --git a/examples/events/main.lua b/examples/events/main.lua index 3a042f1..5643668 100644 --- a/examples/events/main.lua +++ b/examples/events/main.lua @@ -31,6 +31,8 @@ local function getEventType( event ) return "Mouse Scroll" elseif event.type == RL.EVENT_CURSOR_ENTER then return "Cursor Enter" + elseif event.type == RL.EVENT_JOYSTICK then + return "Joystick" end return "Unknown" @@ -90,6 +92,13 @@ function RL.event( event ) elseif event.type == RL.EVENT_CURSOR_ENTER then text = text.."enter: "..event.enter cursorIn = event.enter + elseif event.type == RL.EVENT_JOYSTICK then + text = text.."jid: "..event.jid.." event: "..event.event + if event.event == RL.GLFW_CONNECTED then + text = text.."\nConnected" + elseif event.event == RL.GLFW_DISCONNECTED then + text = text.."\nDisconnected" + end end end -- cgit v1.2.3