1 package kibodo 2 3 import ( 4 "github.com/hajimehoshi/ebiten/v2" 5 ) 6 7 // Key represents a virtual key. 8 type Key struct { 9 LowerLabel string 10 UpperLabel string 11 LowerInput *Input 12 UpperInput *Input 13 14 x, y int 15 w, h int 16 17 pressed bool 18 pressedTouchID ebiten.TouchID 19 } 20 21 // Input represents the input event from a key press. 22 type Input struct { 23 Rune rune 24 Key ebiten.Key 25 } 26 27 func (i *Input) String() string { 28 if i.Rune > 0 { 29 return string(i.Rune) 30 } 31 return i.Key.String() 32 } 33