io/pointer: rename button names to reflect their meaning, not placement

For example, ButtonLeft may be the right-most button for a left-handed user.
Rename the button names to match their intended use.

This is an API change. Use the following commands to update your
projects:

    $ gofmt -r 'pointer.ButtonLeft -> pointer.ButtonPrimary' -w .
    $ gofmt -r 'pointer.ButtonRight -> pointer.ButtonSecondary' -w .
    $ gofmt -r 'pointer.ButtonMiddle -> pointer.ButtonTertiary' -w .

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-03-03 11:03:38 +01:00
parent f36ed04380
commit ffb26b0e17
13 changed files with 48 additions and 43 deletions
+3 -3
View File
@@ -200,13 +200,13 @@ func gio_onMouse(view C.CFTypeRef, cdir C.int, cbtns C.NSUInteger, x, y, dx, dy
}
var btns pointer.Buttons
if cbtns&(1<<0) != 0 {
btns |= pointer.ButtonLeft
btns |= pointer.ButtonPrimary
}
if cbtns&(1<<1) != 0 {
btns |= pointer.ButtonRight
btns |= pointer.ButtonSecondary
}
if cbtns&(1<<2) != 0 {
btns |= pointer.ButtonMiddle
btns |= pointer.ButtonTertiary
}
t := time.Duration(float64(ti)*float64(time.Second) + .5)
w := mustView(view)