local ffi = require("ffi")
local user32 = ffi.load("user32")
ffi.cdef[[
typedef struct { int x; int y; } POINT;
int GetCursorPos(POINT *lpPoint);
int GetSystemMetrics(int nIndex);
]]
function getCursorPos()
local pt = ffi.new("POINT")
user32.GetCursorPos(pt)
return (pt.x / user32.GetSystemMetrics(0)) * 1920, (pt.y / user32.GetSystemMetrics(1)) * 1080
end