ebiten: swap the definition MouseButtonMiddle and MouseButtonRight

This follows the Web standard.

Closes #2468
This commit is contained in:
Hajime Hoshi 2022-11-27 13:51:07 +09:00
parent f37deea6e2
commit 3386908902
3 changed files with 6 additions and 6 deletions

View File

@ -150,8 +150,8 @@ func (i *Input) Wheel() (xoff, yoff float64) {
var glfwMouseButtonToMouseButton = map[glfw.MouseButton]MouseButton{ var glfwMouseButtonToMouseButton = map[glfw.MouseButton]MouseButton{
glfw.MouseButtonLeft: MouseButton0, glfw.MouseButtonLeft: MouseButton0,
glfw.MouseButtonRight: MouseButton1, glfw.MouseButtonMiddle: MouseButton1,
glfw.MouseButtonMiddle: MouseButton2, glfw.MouseButtonRight: MouseButton2,
glfw.MouseButton3: MouseButton3, glfw.MouseButton3: MouseButton3,
glfw.MouseButton4: MouseButton4, glfw.MouseButton4: MouseButton4,
} }

View File

@ -127,8 +127,8 @@ func (i *Input) IsKeyPressed(key Key) bool {
var codeToMouseButton = map[int]MouseButton{ var codeToMouseButton = map[int]MouseButton{
0: MouseButton0, // Left 0: MouseButton0, // Left
1: MouseButton2, // Middle 1: MouseButton1, // Middle
2: MouseButton1, // Right 2: MouseButton2, // Right
3: MouseButton3, 3: MouseButton3,
4: MouseButton4, 4: MouseButton4,
} }

View File

@ -24,8 +24,8 @@ type MouseButton = ui.MouseButton
// MouseButtons // MouseButtons
const ( const (
MouseButtonLeft MouseButton = MouseButton0 MouseButtonLeft MouseButton = MouseButton0
MouseButtonRight MouseButton = MouseButton1 MouseButtonMiddle MouseButton = MouseButton1
MouseButtonMiddle MouseButton = MouseButton2 MouseButtonRight MouseButton = MouseButton2
MouseButton0 MouseButton = ui.MouseButton0 MouseButton0 MouseButton = ui.MouseButton0
MouseButton1 MouseButton = ui.MouseButton1 MouseButton1 MouseButton = ui.MouseButton1