You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
470 B
32 lines
470 B
package kibodo |
|
|
|
import ( |
|
"github.com/hajimehoshi/ebiten/v2" |
|
) |
|
|
|
// Key represents a virtual key. |
|
type Key struct { |
|
LowerLabel string |
|
UpperLabel string |
|
LowerInput *Input |
|
UpperInput *Input |
|
|
|
x, y int |
|
w, h int |
|
|
|
pressed bool |
|
pressedTouchID ebiten.TouchID |
|
} |
|
|
|
// Input represents the input from a key press. |
|
type Input struct { |
|
Rune rune |
|
Key ebiten.Key |
|
} |
|
|
|
func (i *Input) String() string { |
|
if i.Rune > 0 { |
|
return string(i.Rune) |
|
} |
|
return i.Key.String() |
|
}
|
|
|