module System.Win32.Automation.Input.Mouse where
import Foreign.Ptr ( Ptr )
import Foreign.Storable ( Storable(..) )
import System.Win32.Types ( LONG, ULONG_PTR )
import System.Win32.Word ( DWORD )
type PMOUSEINPUT = Ptr MOUSEINPUT
data MOUSEINPUT = MOUSEINPUT
{ dx :: LONG
, dy :: LONG
, mouseData :: DWORD
, dwFlags :: DWORD
, time :: DWORD
, dwExtraInfo :: ULONG_PTR
} deriving Show
instance Storable MOUSEINPUT where
sizeOf = const (32)
alignment _ = 8
poke buf input = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) buf (dx input)
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) buf (dx input)
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) buf (mouseData input)
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) buf (dwFlags input)
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) buf (time input)
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) buf (dwExtraInfo input)
peek buf = do
dx' <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) buf
dy' <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) buf
mouseData' <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) buf
dwFlags' <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) buf
time' <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) buf
dwExtraInfo' <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) buf
return $ MOUSEINPUT dx' dy' mouseData' dwFlags' time' dwExtraInfo'
xBUTTON1 :: DWORD
xBUTTON1 = 1
xBUTTON2 :: DWORD
xBUTTON2 = 2
mOUSEEVENTF_ABSOLUTE :: DWORD
mOUSEEVENTF_ABSOLUTE = 32768
mOUSEEVENTF_MOVE :: DWORD
mOUSEEVENTF_MOVE = 1
mOUSEEVENTF_LEFTDOWN :: DWORD
mOUSEEVENTF_LEFTDOWN = 2
mOUSEEVENTF_LEFTUP :: DWORD
mOUSEEVENTF_LEFTUP = 4
mOUSEEVENTF_RIGHTDOWN :: DWORD
mOUSEEVENTF_RIGHTDOWN = 8
mOUSEEVENTF_RIGHTUP :: DWORD
mOUSEEVENTF_RIGHTUP = 16
mOUSEEVENTF_MIDDLEDOWN :: DWORD
mOUSEEVENTF_MIDDLEDOWN = 32
mOUSEEVENTF_MIDDLEUP :: DWORD
mOUSEEVENTF_MIDDLEUP = 64
mOUSEEVENTF_WHEEL :: DWORD
mOUSEEVENTF_WHEEL = 2048
mOUSEEVENTF_XDOWN :: DWORD
mOUSEEVENTF_XDOWN = 128
mOUSEEVENTF_XUP :: DWORD
mOUSEEVENTF_XUP = 256