user32.odin 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. // +build windows
  2. package sys_windows
  3. foreign import user32 "system:User32.lib"
  4. @(default_calling_convention="stdcall")
  5. foreign user32 {
  6. GetClassInfoW :: proc(hInstance: HINSTANCE, lpClassNAme: LPCWSTR, lpWndClass: ^WNDCLASSW) -> BOOL ---
  7. GetClassInfoExW :: proc(hInsatnce: HINSTANCE, lpszClass: LPCWSTR, lpwcx: ^WNDCLASSEXW) -> BOOL ---
  8. GetClassLongW :: proc(hWnd: HWND, nIndex: c_int) -> DWORD ---
  9. SetClassLongW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> DWORD ---
  10. GetWindowLongW :: proc(hWnd: HWND, nIndex: c_int) -> LONG ---
  11. SetWindowLongW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> LONG ---
  12. GetClassNameW :: proc(hWnd: HWND, lpClassName: LPWSTR, nMaxCount: c_int) -> c_int ---
  13. RegisterClassW :: proc(lpWndClass: ^WNDCLASSW) -> ATOM ---
  14. RegisterClassExW :: proc(^WNDCLASSEXW) -> ATOM ---
  15. UnregisterClassW :: proc(lpClassName: LPCWSTR, hInstance: HINSTANCE) -> BOOL ---
  16. CreateWindowExW :: proc(
  17. dwExStyle: DWORD,
  18. lpClassName: LPCWSTR,
  19. lpWindowName: LPCWSTR,
  20. dwStyle: DWORD,
  21. X: c_int,
  22. Y: c_int,
  23. nWidth: c_int,
  24. nHeight: c_int,
  25. hWndParent: HWND,
  26. hMenu: HMENU,
  27. hInstance: HINSTANCE,
  28. lpParam: LPVOID,
  29. ) -> HWND ---
  30. DestroyWindow :: proc(hWnd: HWND) -> BOOL ---
  31. ShowWindow :: proc(hWnd: HWND, nCmdShow: c_int) -> BOOL ---
  32. BringWindowToTop :: proc(hWnd: HWND) -> BOOL ---
  33. GetTopWindow :: proc(hWnd: HWND) -> HWND ---
  34. SetForegroundWindow :: proc(hWnd: HWND) -> BOOL ---
  35. GetForegroundWindow :: proc() -> HWND ---
  36. UpdateWindow :: proc(hWnd: HWND) -> BOOL ---
  37. SetActiveWindow :: proc(hWnd: HWND) -> HWND ---
  38. GetActiveWindow :: proc() -> HWND ---
  39. GetMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) -> BOOL ---
  40. TranslateMessage :: proc(lpMsg: ^MSG) -> BOOL ---
  41. DispatchMessageW :: proc(lpMsg: ^MSG) -> LRESULT ---
  42. PeekMessageA :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL ---
  43. PeekMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL ---
  44. PostMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  45. PostMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  46. SendMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  47. SendMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  48. PostThreadMessageA :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  49. PostThreadMessageW :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  50. PostQuitMessage :: proc(nExitCode: c_int) ---
  51. GetQueueStatus :: proc(flags: UINT) -> DWORD ---
  52. DefWindowProcA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  53. DefWindowProcW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  54. FindWindowA :: proc(lpClassName: LPCSTR, lpWindowName: LPCSTR) -> HWND ---
  55. FindWindowW :: proc(lpClassName: LPCWSTR, lpWindowName: LPCWSTR) -> HWND ---
  56. FindWindowExA :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCSTR, lpszWindow: LPCSTR) -> HWND ---
  57. FindWindowExW :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCWSTR, lpszWindow: LPCWSTR) -> HWND ---
  58. LoadIconA :: proc(hInstance: HINSTANCE, lpIconName: LPCSTR) -> HICON ---
  59. LoadIconW :: proc(hInstance: HINSTANCE, lpIconName: LPCWSTR) -> HICON ---
  60. LoadCursorA :: proc(hInstance: HINSTANCE, lpCursorName: LPCSTR) -> HCURSOR ---
  61. LoadCursorW :: proc(hInstance: HINSTANCE, lpCursorName: LPCWSTR) -> HCURSOR ---
  62. GetWindowRect :: proc(hWnd: HWND, lpRect: LPRECT) -> BOOL ---
  63. GetClientRect :: proc(hWnd: HWND, lpRect: LPRECT) -> BOOL ---
  64. ClientToScreen :: proc(hWnd: HWND, lpPoint: LPPOINT) -> BOOL ---
  65. ScreenToClient :: proc(hWnd: HWND, lpPoint: LPPOINT) -> BOOL ---
  66. SetWindowPos :: proc(
  67. hWnd: HWND,
  68. hWndInsertAfter: HWND,
  69. X: c_int,
  70. Y: c_int,
  71. cx: c_int,
  72. cy: c_int,
  73. uFlags: UINT,
  74. ) -> BOOL ---
  75. MoveWindow :: proc(hWnd: HWND, X, Y, hWidth, hHeight: c_int, bRepaint: BOOL) -> BOOL ---
  76. GetSystemMetrics :: proc(nIndex: c_int) -> c_int ---
  77. AdjustWindowRect :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL) -> BOOL ---
  78. AdjustWindowRectEx :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL, dwExStyle: DWORD) -> BOOL ---
  79. AdjustWindowRectExForDpi :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL, dwExStyle: DWORD, dpi: UINT) -> BOOL ---
  80. SystemParametersInfoW :: proc(uiAction, uiParam: UINT, pvParam: PVOID, fWinIni: UINT) -> BOOL ---
  81. GetWindowDC :: proc(hWnd: HWND) -> HDC ---
  82. GetDC :: proc(hWnd: HWND) -> HDC ---
  83. ReleaseDC :: proc(hWnd: HWND, hDC: HDC) -> c_int ---
  84. GetUpdateRect :: proc(hWnd: HWND, lpRect: LPRECT, bErase: BOOL) -> BOOL ---
  85. ValidateRect :: proc(hWnd: HWND, lpRect: ^RECT) -> BOOL ---
  86. InvalidateRect :: proc(hWnd: HWND, lpRect: ^RECT, bErase: BOOL) -> BOOL ---
  87. BeginPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> HDC ---
  88. EndPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> BOOL ---
  89. GetCapture :: proc() -> HWND ---
  90. SetCapture :: proc(hWnd: HWND) -> HWND ---
  91. ReleaseCapture :: proc() -> BOOL ---
  92. TrackMouseEvent :: proc(lpEventTrack: LPTRACKMOUSEEVENT) -> BOOL ---
  93. GetKeyState :: proc(nVirtKey: c_int) -> SHORT ---
  94. GetAsyncKeyState :: proc(vKey: c_int) -> SHORT ---
  95. MapVirtualKeyW :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
  96. SetWindowsHookExW :: proc(idHook: c_int, lpfn: HOOKPROC, hmod: HINSTANCE, dwThreadId: DWORD) -> HHOOK ---
  97. UnhookWindowsHookEx :: proc(hhk: HHOOK) -> BOOL ---
  98. CallNextHookEx :: proc(hhk: HHOOK, nCode: c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  99. SetTimer :: proc(hWnd: HWND, nIDEvent: UINT_PTR, uElapse: UINT, lpTimerFunc: TIMERPROC) -> UINT_PTR ---
  100. KillTimer :: proc(hWnd: HWND, uIDEvent: UINT_PTR) -> BOOL ---
  101. // MessageBoxA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT) -> c_int ---
  102. MessageBoxW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT) -> c_int ---
  103. // MessageBoxExA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, wLanguageId: WORD) -> c_int ---
  104. MessageBoxExW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT, wLanguageId: WORD) -> c_int ---
  105. ClipCursor :: proc(lpRect: LPRECT) -> BOOL ---
  106. GetCursorPos :: proc(lpPoint: LPPOINT) -> BOOL ---
  107. SetCursorPos :: proc(X: c_int, Y: c_int) -> BOOL ---
  108. SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR ---
  109. EnumDisplaySettingsW :: proc(lpszDeviceName: LPCWSTR, iModeNum: DWORD, lpDevMode: ^DEVMODEW) -> BOOL ---
  110. MonitorFromPoint :: proc(pt: POINT, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  111. MonitorFromRect :: proc(lprc: LPRECT, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  112. MonitorFromWindow :: proc(hwnd: HWND, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  113. EnumDisplayMonitors :: proc(hdc: HDC, lprcClip: LPRECT, lpfnEnum: Monitor_Enum_Proc, dwData: LPARAM) -> BOOL ---
  114. SetThreadDpiAwarenessContext :: proc(dpiContext: DPI_AWARENESS_CONTEXT) -> DPI_AWARENESS_CONTEXT ---
  115. GetThreadDpiAwarenessContext :: proc() -> DPI_AWARENESS_CONTEXT ---
  116. GetWindowDpiAwarenessContext :: proc(hwnd: HWND) -> DPI_AWARENESS_CONTEXT ---
  117. GetDpiFromDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> UINT ---
  118. GetDpiForWindow :: proc(hwnd: HWND) -> UINT ---
  119. SetProcessDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> BOOL ---
  120. BroadcastSystemMessageW :: proc(
  121. flags: DWORD,
  122. lpInfo: LPDWORD,
  123. Msg: UINT,
  124. wParam: WPARAM,
  125. lParam: LPARAM,
  126. ) -> c_long ---
  127. BroadcastSystemMessageExW :: proc(
  128. flags: DWORD,
  129. lpInfo: LPDWORD,
  130. Msg: UINT,
  131. wParam: WPARAM,
  132. lParam: LPARAM,
  133. pbsmInfo: PBSMINFO,
  134. ) -> c_long ---
  135. SendMessageTimeoutW :: proc(
  136. hWnd: HWND,
  137. Msg: UINT,
  138. wParam: WPARAM,
  139. lParam: LPARAM,
  140. fuFlags: UINT,
  141. uTimeout: UINT,
  142. lpdwResult: PDWORD_PTR,
  143. ) -> LRESULT ---
  144. GetSysColor :: proc(nIndex: c_int) -> DWORD ---
  145. GetSysColorBrush :: proc(nIndex: c_int) -> HBRUSH ---
  146. SetSysColors :: proc(cElements: c_int, lpaElements: ^INT, lpaRgbValues: ^COLORREF) -> BOOL ---
  147. MessageBeep :: proc(uType: UINT) -> BOOL ---
  148. IsDialogMessageW :: proc(hDlg: HWND, lpMsg: LPMSG) -> BOOL ---
  149. GetWindowTextLengthW :: proc(hWnd: HWND) -> c_int ---
  150. GetWindowTextW :: proc(hWnd: HWND, lpString: LPWSTR, nMaxCount: c_int) -> c_int ---
  151. SetWindowTextW :: proc(hWnd: HWND, lpString: LPCWSTR) -> BOOL ---
  152. CallWindowProcW :: proc(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  153. EnableWindow :: proc(hWnd: HWND, bEnable: BOOL) -> BOOL ---
  154. DefRawInputProc :: proc(paRawInput: ^PRAWINPUT, nInput: INT, cbSizeHeader: UINT) -> LRESULT ---
  155. GetRawInputBuffer :: proc(pRawInput: PRAWINPUT, pcbSize: PUINT, cbSizeHeader: UINT) -> UINT ---
  156. GetRawInputData :: proc(hRawInput: HRAWINPUT, uiCommand: UINT, pData: LPVOID, pcbSize: PUINT, cbSizeHeader: UINT) -> UINT ---
  157. GetRawInputDeviceInfoW :: proc(hDevice: HANDLE, uiCommand: UINT, pData: LPVOID, pcbSize: PUINT) -> UINT ---
  158. GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
  159. GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
  160. RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL ---
  161. }
  162. CreateWindowW :: #force_inline proc "stdcall" (
  163. lpClassName: LPCTSTR,
  164. lpWindowName: LPCTSTR,
  165. dwStyle: DWORD,
  166. X: c_int,
  167. Y: c_int,
  168. nWidth: c_int,
  169. nHeight: c_int,
  170. hWndParent: HWND,
  171. hMenu: HMENU,
  172. hInstance: HINSTANCE,
  173. lpParam: LPVOID,
  174. ) -> HWND {
  175. return CreateWindowExW(
  176. 0,
  177. lpClassName,
  178. lpWindowName,
  179. dwStyle,
  180. X,
  181. Y,
  182. nWidth,
  183. nHeight,
  184. hWndParent,
  185. hMenu,
  186. hInstance,
  187. lpParam,
  188. )
  189. }
  190. when ODIN_ARCH == .amd64 {
  191. @(default_calling_convention="stdcall")
  192. foreign user32 {
  193. GetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int) -> ULONG_PTR ---
  194. SetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> ULONG_PTR ---
  195. GetWindowLongPtrW :: proc(hWnd: HWND, nIndex: c_int) -> LONG_PTR ---
  196. SetWindowLongPtrW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> LONG_PTR ---
  197. }
  198. } else when ODIN_ARCH == .i386 {
  199. GetClassLongPtrW :: GetClassLongW
  200. SetClassLongPtrW :: SetClassLongW
  201. GetWindowLongPtrW :: GetWindowLongW
  202. SetWindowLongPtrW :: SetWindowLongW
  203. }
  204. GET_SC_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> c_int {
  205. return c_int(wParam) & 0xFFF0
  206. }
  207. GET_WHEEL_DELTA_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> c_short {
  208. return cast(c_short)HIWORD(cast(DWORD)wParam)
  209. }
  210. GET_KEYSTATE_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> WORD {
  211. return LOWORD(cast(DWORD)wParam)
  212. }
  213. GET_NCHITTEST_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> c_short {
  214. return cast(c_short)LOWORD(cast(DWORD)wParam)
  215. }
  216. GET_XBUTTON_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> WORD {
  217. return HIWORD(cast(DWORD)wParam)
  218. }
  219. MAKEINTRESOURCEW :: #force_inline proc "contextless" (#any_int i: int) -> LPWSTR {
  220. return cast(LPWSTR)uintptr(WORD(i))
  221. }
  222. Monitor_From_Flags :: enum DWORD {
  223. MONITOR_DEFAULTTONULL = 0x00000000, // Returns NULL
  224. MONITOR_DEFAULTTOPRIMARY = 0x00000001, // Returns a handle to the primary display monitor
  225. MONITOR_DEFAULTTONEAREST = 0x00000002, // Returns a handle to the display monitor that is nearest to the window
  226. }
  227. Monitor_Enum_Proc :: #type proc "stdcall" (HMONITOR, HDC, LPRECT, LPARAM) -> BOOL
  228. USER_DEFAULT_SCREEN_DPI :: 96
  229. DPI_AWARENESS_CONTEXT :: distinct HANDLE
  230. DPI_AWARENESS_CONTEXT_UNAWARE :: DPI_AWARENESS_CONTEXT(~uintptr(0)) // -1
  231. DPI_AWARENESS_CONTEXT_SYSTEM_AWARE :: DPI_AWARENESS_CONTEXT(~uintptr(1)) // -2
  232. DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE :: DPI_AWARENESS_CONTEXT(~uintptr(2)) // -3
  233. DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 :: DPI_AWARENESS_CONTEXT(~uintptr(3)) // -4
  234. DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED :: DPI_AWARENESS_CONTEXT(~uintptr(4)) // -5
  235. RAWINPUTHEADER :: struct {
  236. dwType: DWORD,
  237. dwSize: DWORD,
  238. hDevice: HANDLE,
  239. wParam: WPARAM,
  240. }
  241. RAWHID :: struct {
  242. dwSizeHid: DWORD,
  243. dwCount: DWORD,
  244. bRawData: [1]BYTE,
  245. }
  246. RAWMOUSE :: struct {
  247. usFlags: USHORT,
  248. DUMMYUNIONNAME: struct #raw_union {
  249. ulButtons: ULONG,
  250. DUMMYSTRUCTNAME: struct {
  251. usButtonFlags: USHORT,
  252. usButtonData: USHORT,
  253. },
  254. },
  255. ulRawButtons: ULONG,
  256. lLastX: LONG,
  257. lLastY: LONG,
  258. ulExtraInformation: ULONG,
  259. }
  260. RAWKEYBOARD :: struct {
  261. MakeCode: USHORT,
  262. Flags: USHORT,
  263. Rserved: USHORT,
  264. VKey: USHORT,
  265. Message: UINT,
  266. ExtraInformation: ULONG,
  267. }
  268. RAWINPUT :: struct {
  269. header: RAWINPUTHEADER,
  270. data: struct #raw_union {
  271. mouse: RAWMOUSE,
  272. keyboard: RAWKEYBOARD,
  273. hid: RAWHID,
  274. },
  275. }
  276. PRAWINPUT :: ^RAWINPUT
  277. HRAWINPUT :: distinct LPARAM
  278. RAWINPUTDEVICE :: struct {
  279. usUsagePage: USHORT,
  280. usUsage: USHORT,
  281. dwFlags: DWORD,
  282. hwndTarget: HWND,
  283. }
  284. PRAWINPUTDEVICE :: ^RAWINPUTDEVICE
  285. PCRAWINPUTDEVICE :: PRAWINPUTDEVICE
  286. RAWINPUTDEVICELIST :: struct {
  287. hDevice: HANDLE,
  288. dwType: DWORD,
  289. }
  290. PRAWINPUTDEVICELIST :: ^RAWINPUTDEVICELIST
  291. RID_DEVICE_INFO_HID :: struct {
  292. dwVendorId: DWORD,
  293. dwProductId: DWORD,
  294. dwVersionNumber: DWORD,
  295. usUsagePage: USHORT,
  296. usUsage: USHORT,
  297. }
  298. RID_DEVICE_INFO_KEYBOARD :: struct {
  299. dwType: DWORD,
  300. dwSubType: DWORD,
  301. dwKeyboardMode: DWORD,
  302. dwNumberOfFunctionKeys: DWORD,
  303. dwNumberOfIndicators: DWORD,
  304. dwNumberOfKeysTotal: DWORD,
  305. }
  306. RID_DEVICE_INFO_MOUSE :: struct {
  307. dwId: DWORD,
  308. dwNumberOfButtons: DWORD,
  309. dwSampleRate: DWORD,
  310. fHasHorizontalWheel: BOOL,
  311. }
  312. RID_DEVICE_INFO :: struct {
  313. cbSize: DWORD,
  314. dwType: DWORD,
  315. DUMMYUNIONNAME: struct #raw_union {
  316. mouse: RID_DEVICE_INFO_MOUSE,
  317. keyboard: RID_DEVICE_INFO_KEYBOARD,
  318. hid: RID_DEVICE_INFO_HID,
  319. },
  320. }
  321. RIDEV_REMOVE :: 0x00000001
  322. RIDEV_EXCLUDE :: 0x00000010
  323. RIDEV_PAGEONLY :: 0x00000020
  324. RIDEV_NOLEGACY :: 0x00000030
  325. RIDEV_INPUTSINK :: 0x00000100
  326. RIDEV_CAPTUREMOUSE :: 0x00000200
  327. RIDEV_NOHOTKEYS :: 0x00000200
  328. RIDEV_APPKEYS :: 0x00000400
  329. RIDEV_EXINPUTSINK :: 0x00001000
  330. RIDEV_DEVNOTIFY :: 0x00002000
  331. RID_HEADER :: 0x10000005
  332. RID_INPUT :: 0x10000003
  333. RIM_TYPEMOUSE :: 0
  334. RIM_TYPEKEYBOARD :: 1
  335. RIM_TYPEHID :: 2
  336. MOUSE_MOVE_RELATIVE :: 0x00
  337. MOUSE_MOVE_ABSOLUTE :: 0x01
  338. MOUSE_VIRTUAL_DESKTOP :: 0x02
  339. MOUSE_ATTRIUBTTES_CHANGED :: 0x04
  340. MOUSE_MOVE_NOCOALESCE :: 0x08
  341. RI_MOUSE_BUTTON_1_DOWN :: 0x0001
  342. RI_MOUSE_LEFT_BUTTON_DOWNS :: RI_MOUSE_BUTTON_1_DOWN
  343. RI_MOUSE_BUTTON_1_UP :: 0x0002
  344. RI_MOUSE_LEFT_BUTTON_UP :: RI_MOUSE_BUTTON_1_UP
  345. RI_MOUSE_BUTTON_2_DOWN :: 0x0004
  346. RI_MOUSE_RIGHT_BUTTON_DOWN :: RI_MOUSE_BUTTON_2_DOWN
  347. RI_MOUSE_BUTTON_2_UP :: 0x0008
  348. RI_MOUSE_RIGHT_BUTTON_UP :: RI_MOUSE_BUTTON_2_UP
  349. RI_MOUSE_BUTTON_3_DOWN :: 0x0010
  350. RI_MOUSE_MIDDLE_BUTTON_DOWN :: RI_MOUSE_BUTTON_3_DOWN
  351. RI_MOUSE_BUTTON_3_UP :: 0x0020
  352. RI_MOUSE_MIDDLE_BUTTON_UP :: RI_MOUSE_BUTTON_3_UP
  353. RI_MOUSE_BUTTON_4_DOWN :: 0x0040
  354. RI_MOUSE_BUTTON_4_UP :: 0x0080
  355. RI_MOUSE_BUTTON_5_DOWN :: 0x0100
  356. RI_MOUSE_BUTTON_5_UP :: 0x0200
  357. RI_MOUSE_WHEEL :: 0x0400
  358. RI_MOUSE_HWHEEL :: 0x0800