mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: make some MouseButton definitions explicit
This change redefines named mouse button consts like MouseButtonLeft to use MouseButton0, so that users can know which enums are the same and different. Updates #2445
This commit is contained in:
parent
6e12fd13e4
commit
9e9cec249a
@ -149,9 +149,9 @@ func (i *Input) Wheel() (xoff, yoff float64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var glfwMouseButtonToMouseButton = map[glfw.MouseButton]MouseButton{
|
var glfwMouseButtonToMouseButton = map[glfw.MouseButton]MouseButton{
|
||||||
glfw.MouseButtonLeft: MouseButtonLeft,
|
glfw.MouseButtonLeft: MouseButton0,
|
||||||
glfw.MouseButtonRight: MouseButtonRight,
|
glfw.MouseButtonRight: MouseButton1,
|
||||||
glfw.MouseButtonMiddle: MouseButtonMiddle,
|
glfw.MouseButtonMiddle: MouseButton2,
|
||||||
glfw.MouseButton3: MouseButton3,
|
glfw.MouseButton3: MouseButton3,
|
||||||
glfw.MouseButton4: MouseButton4,
|
glfw.MouseButton4: MouseButton4,
|
||||||
}
|
}
|
||||||
|
@ -126,9 +126,9 @@ func (i *Input) IsKeyPressed(key Key) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var codeToMouseButton = map[int]MouseButton{
|
var codeToMouseButton = map[int]MouseButton{
|
||||||
0: MouseButtonLeft,
|
0: MouseButton0, // Left
|
||||||
1: MouseButtonMiddle,
|
1: MouseButton2, // Middle
|
||||||
2: MouseButtonRight,
|
2: MouseButton1, // Right
|
||||||
3: MouseButton3,
|
3: MouseButton3,
|
||||||
4: MouseButton4,
|
4: MouseButton4,
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,11 @@ import (
|
|||||||
type MouseButton int
|
type MouseButton int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MouseButton0 MouseButton = iota
|
MouseButton0 MouseButton = iota // The 'left' button
|
||||||
MouseButton1
|
MouseButton1 // The 'right' button
|
||||||
MouseButton2
|
MouseButton2 // The 'middle' button
|
||||||
MouseButton3
|
MouseButton3 // The additional button (usually browser-back)
|
||||||
MouseButton4
|
MouseButton4 // The additional button (usually browser-forward)
|
||||||
|
|
||||||
MouseButtonLeft = MouseButton0
|
|
||||||
MouseButtonRight = MouseButton1
|
|
||||||
MouseButtonMiddle = MouseButton2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TouchID int
|
type TouchID int
|
||||||
|
@ -23,13 +23,14 @@ type MouseButton = ui.MouseButton
|
|||||||
|
|
||||||
// MouseButtons
|
// MouseButtons
|
||||||
const (
|
const (
|
||||||
MouseButtonLeft MouseButton = ui.MouseButtonLeft
|
MouseButtonLeft MouseButton = MouseButton0
|
||||||
MouseButtonRight MouseButton = ui.MouseButtonRight
|
MouseButtonRight MouseButton = MouseButton1
|
||||||
MouseButtonMiddle MouseButton = ui.MouseButtonMiddle
|
MouseButtonMiddle MouseButton = MouseButton2
|
||||||
MouseButton0 MouseButton = ui.MouseButton0
|
|
||||||
MouseButton1 MouseButton = ui.MouseButton1
|
MouseButton0 MouseButton = ui.MouseButton0
|
||||||
MouseButton2 MouseButton = ui.MouseButton2
|
MouseButton1 MouseButton = ui.MouseButton1
|
||||||
MouseButton3 MouseButton = ui.MouseButton3
|
MouseButton2 MouseButton = ui.MouseButton2
|
||||||
MouseButton4 MouseButton = ui.MouseButton4
|
MouseButton3 MouseButton = ui.MouseButton3
|
||||||
MouseButtonMax MouseButton = MouseButton4
|
MouseButton4 MouseButton = ui.MouseButton4
|
||||||
|
MouseButtonMax MouseButton = MouseButton4
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user