MCPcopy
hub / github.com/lxn/walk / publishMouseEvent

Method publishMouseEvent

window.go:2035–2055  ·  view source on GitHub ↗
(publisher *MouseEventPublisher, msg uint32, wParam, lParam uintptr)

Source from the content-addressed store, hash-verified

2033}
2034
2035func (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
2057func (wb *WindowBase) publishMouseWheelEvent(publisher *MouseEventPublisher, wParam, lParam uintptr) {
2058 x := int(win.GET_X_LPARAM(lParam))

Callers 2

WndProcMethod · 0.95
lvWndProcMethod · 0.45

Calls 2

MouseButtonTypeAlias · 0.85
PublishMethod · 0.45

Tested by

no test coverage detected