...
1 package etk
2
3 import (
4 "time"
5
6 "github.com/hajimehoshi/ebiten/v2"
7 )
8
9
10 type Shortcuts struct {
11 DoubleClickThreshold time.Duration
12
13 MoveLeftKeyboard []ebiten.Key
14 MoveRightKeyboard []ebiten.Key
15 MoveDownKeyboard []ebiten.Key
16 MoveUpKeyboard []ebiten.Key
17
18 MoveLeftGamepad []ebiten.StandardGamepadButton
19 MoveRightGamepad []ebiten.StandardGamepadButton
20 MoveDownGamepad []ebiten.StandardGamepadButton
21 MoveUpGamepad []ebiten.StandardGamepadButton
22
23 ConfirmKeyboard []ebiten.Key
24 ConfirmMouse []ebiten.MouseButton
25 ConfirmGamepad []ebiten.StandardGamepadButton
26
27
28
29 ConfirmRune rune
30 BackRune rune
31 }
32
33
34 var Bindings = &Shortcuts{
35 DoubleClickThreshold: 200 * time.Millisecond,
36
37 MoveLeftKeyboard: []ebiten.Key{ebiten.KeyLeft},
38 MoveRightKeyboard: []ebiten.Key{ebiten.KeyRight},
39 MoveDownKeyboard: []ebiten.Key{ebiten.KeyDown},
40 MoveUpKeyboard: []ebiten.Key{ebiten.KeyUp},
41
42 MoveLeftGamepad: []ebiten.StandardGamepadButton{ebiten.StandardGamepadButtonLeftLeft},
43 MoveRightGamepad: []ebiten.StandardGamepadButton{ebiten.StandardGamepadButtonLeftRight},
44 MoveDownGamepad: []ebiten.StandardGamepadButton{ebiten.StandardGamepadButtonLeftBottom},
45 MoveUpGamepad: []ebiten.StandardGamepadButton{ebiten.StandardGamepadButtonLeftTop},
46
47 ConfirmKeyboard: []ebiten.Key{ebiten.KeyEnter, ebiten.KeyKPEnter},
48 ConfirmMouse: []ebiten.MouseButton{ebiten.MouseButtonLeft, ebiten.MouseButtonRight},
49 ConfirmGamepad: []ebiten.StandardGamepadButton{ebiten.StandardGamepadButtonRightBottom},
50 }
51
View as plain text