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 Wide bool 14 15 x, y int 16 w, h int 17 18 pressed bool 19 pressedTouchID ebiten.TouchID 20 } 21 22 // Input represents the input event from a key press. 23 type Input struct { 24 Rune rune 25 Key ebiten.Key 26 } 27 28 func (i *Input) String() string { 29 if i.Rune > 0 { 30 return string(i.Rune) 31 } 32 return i.Key.String() 33 } 34