diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-12 05:09:20 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-12 05:11:17 -0400 |
| commit | 1873b72d49c2dabbbffc556f8e45c8b8828343f1 (patch) | |
| tree | 08af0a7d143a7bac6ff802e9c8b6da4fe7683a28 /redo/area_windows.go | |
| parent | eb504480b192763ca62d15fa1d693c1a7afd6914 (diff) | |
Got rid of the direct use of WPARAM in Area mouse events on Windows. Whatever happened between then and now, Held works on both Windows and GTK+ now...
Diffstat (limited to 'redo/area_windows.go')
| -rw-r--r-- | redo/area_windows.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/redo/area_windows.go b/redo/area_windows.go index 0137a3f..05f0274 100644 --- a/redo/area_windows.go +++ b/redo/area_windows.go @@ -108,7 +108,7 @@ func getModifiers() (m Modifiers) { } //export finishAreaMouseEvent -func finishAreaMouseEvent(data unsafe.Pointer, cbutton C.DWORD, up C.BOOL, wParam C.WPARAM, xpos C.int, ypos C.int) { +func finishAreaMouseEvent(data unsafe.Pointer, cbutton C.DWORD, up C.BOOL, heldButtons C.uintptr_t, xpos C.int, ypos C.int) { var me MouseEvent a := (*area)(data) @@ -133,21 +133,19 @@ func finishAreaMouseEvent(data unsafe.Pointer, cbutton C.DWORD, up C.BOOL, wPara } // though wparam will contain control and shift state, let's use just one function to get modifiers for both keyboard and mouse events; it'll work the same anyway since we have to do this for alt and windows key (super) me.Modifiers = getModifiers() - // TODO make wParam unsigned - // TODO XBUTTONs use something different - if button != 1 && (wParam & C.MK_LBUTTON) != 0 { + if button != 1 && (heldButtons & C.MK_LBUTTON) != 0 { me.Held = append(me.Held, 1) } - if button != 2 && (wParam & C.MK_MBUTTON) != 0 { + if button != 2 && (heldButtons & C.MK_MBUTTON) != 0 { me.Held = append(me.Held, 2) } - if button != 3 && (wParam & C.MK_RBUTTON) != 0 { + if button != 3 && (heldButtons & C.MK_RBUTTON) != 0 { me.Held = append(me.Held, 3) } - if button != 4 && (wParam & C.MK_XBUTTON1) != 0 { + if button != 4 && (heldButtons & C.MK_XBUTTON1) != 0 { me.Held = append(me.Held, 4) } - if button != 5 && (wParam & C.MK_XBUTTON2) != 0 { + if button != 5 && (heldButtons & C.MK_XBUTTON2) != 0 { me.Held = append(me.Held, 5) } a.handler.Mouse(me) |
