-
Notifications
You must be signed in to change notification settings - Fork 73
Sdl getMouseState
Tangent 128 edited this page Mar 28, 2015
·
3 revisions
Use this function to retrieve the current state of the mouse.
state, x, y = function SDL.getMouseState()
- state, the state of buttons as enumeration (see SDL.mouseMask)
- x, the current x coordinate
- y, the current y coordinate
local state, x, y = SDL.getMouseState()
-- Check for buttons left and right
if state[SDL.mouseMask.Left] then
print("Left is pressed")
end
if state[SDL.mouseMask.Right] then
print("Right is pressed")
end
print("x = " .. x)
print("y = " .. y)