(publisher *MouseEventPublisher, msg uint32, wParam, lParam uintptr)
| 2033 | } |
| 2034 | |
| 2035 | func (wb *WindowBase) publishMouseEvent(publisher *MouseEventPublisher, msg uint32, wParam, lParam uintptr) { |
| 2036 | x := int(win.GET_X_LPARAM(lParam)) |
| 2037 | y := int(win.GET_Y_LPARAM(lParam)) |
| 2038 | |
| 2039 | var button MouseButton |
| 2040 | switch msg { |
| 2041 | case win.WM_LBUTTONUP: |
| 2042 | button = LeftButton |
| 2043 | |
| 2044 | case win.WM_RBUTTONUP: |
| 2045 | button = RightButton |
| 2046 | |
| 2047 | case win.WM_MBUTTONUP: |
| 2048 | button = MiddleButton |
| 2049 | |
| 2050 | default: |
| 2051 | button = MouseButton(wParam&win.MK_LBUTTON | wParam&win.MK_RBUTTON | wParam&win.MK_MBUTTON) |
| 2052 | } |
| 2053 | |
| 2054 | publisher.Publish(x, y, button) |
| 2055 | } |
| 2056 | |
| 2057 | func (wb *WindowBase) publishMouseWheelEvent(publisher *MouseEventPublisher, wParam, lParam uintptr) { |
| 2058 | x := int(win.GET_X_LPARAM(lParam)) |
no test coverage detected