Skip to content

Commit

Permalink
Mouse - handle if mobile OS
Browse files Browse the repository at this point in the history
  • Loading branch information
flamendless committed May 29, 2023
1 parent d560d7c commit a762b38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Internal/Core/Utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,17 @@ function Utility.TableCount(Table)
return Result
end

local OS = love.system.getOS()
function Utility.IsWindows()
return love.system.getOS() == "Windows"
return OS == "Windows"
end

function Utility.IsOSX()
return love.system.getOS() == "OS X"
return OS == "OS X"
end

function Utility.IsMobile()
return love.system.getOS() == "Android" or love.system.getOS() == "iOS"
return (OS == "Android") or (OS == "iOS")
end

function Utility.Clamp(Value, Min, Max)
Expand Down
3 changes: 2 additions & 1 deletion Internal/Input/Mouse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local Common = require(SLAB_PATH .. '.Internal.Input.Common')
local DrawCommands = require(SLAB_PATH .. '.Internal.Core.DrawCommands')
local TablePool = require(SLAB_PATH .. '.Internal.Core.TablePool')
local Scale = require(SLAB_PATH .. ".Internal.Core.Scale")
local Utility = require(SLAB_PATH .. ".Internal.Core.Utility")


local Mouse = {}
Expand Down Expand Up @@ -165,7 +166,7 @@ function Mouse.Update()
State.AsyncDeltaX = 0
State.AsyncDeltaY = 0

if Cursors == nil then
if Cursors == nil and (not Utility.IsMobile()) then
Cursors = {}
Cursors.Arrow = love.mouse.getSystemCursor('arrow')
Cursors.SizeWE = love.mouse.getSystemCursor('sizewe')
Expand Down

0 comments on commit a762b38

Please sign in to comment.