mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
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:
@@ -362,11 +362,11 @@ func (h *x11EventHandler) handleEvents() bool {
|
||||
const scrollScale = 10
|
||||
switch bevt.button {
|
||||
case C.Button1:
|
||||
btn = pointer.ButtonLeft
|
||||
btn = pointer.ButtonPrimary
|
||||
case C.Button2:
|
||||
btn = pointer.ButtonMiddle
|
||||
btn = pointer.ButtonTertiary
|
||||
case C.Button3:
|
||||
btn = pointer.ButtonRight
|
||||
btn = pointer.ButtonSecondary
|
||||
case C.Button4:
|
||||
// scroll up
|
||||
ev.Type = pointer.Scroll
|
||||
|
||||
Reference in New Issue
Block a user