etk/keybind.go

23 lines
738 B
Go
Raw Normal View History

2022-07-07 21:53:14 +00:00
package etk
import "github.com/hajimehoshi/ebiten/v2"
2023-10-29 06:04:32 +00:00
// Shortcuts represents a keyboard shortcut configuration.
2022-07-07 21:53:14 +00:00
type Shortcuts struct {
ConfirmKeyboard []ebiten.Key
ConfirmMouse []ebiten.MouseButton
ConfirmGamepad []ebiten.GamepadButton
// A sentinel rune value may be set for the confirm and back actions.
// This allows working around on-screen keyboard issues on Android.
ConfirmRune rune
BackRune rune
2022-07-07 21:53:14 +00:00
}
2023-10-29 06:04:32 +00:00
// Bindings is the current keyboard shortcut configuration.
2022-07-07 21:53:14 +00:00
var Bindings = &Shortcuts{
ConfirmKeyboard: []ebiten.Key{ebiten.KeyEnter, ebiten.KeyKPEnter},
ConfirmMouse: []ebiten.MouseButton{ebiten.MouseButtonLeft, ebiten.MouseButtonRight},
2022-07-07 21:53:14 +00:00
ConfirmGamepad: []ebiten.GamepadButton{ebiten.GamepadButton0},
}