Added rendering stuff, updated go mod

This commit is contained in:
2024-08-08 18:51:51 -06:00
parent f7eaa0d08d
commit d426892e6a
9 changed files with 447 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
package renderer
type UiAction rune
const (
Unknown UiAction = iota
Quit UiAction = 81 // 'Q'
Left UiAction = 65
Up UiAction = 87
Right UiAction = 68
Down UiAction = 83
LeftArrow UiAction = 8592
UpArrow UiAction = 8593
RightArrow UiAction = 8594
DownArrow UiAction = 8595
)
func ProcessInput(rawInput rune) (action UiAction) {
inputVal := int(rawInput)
// Convert to UpperCase
if inputVal >= 97 && inputVal <= 122 {
inputVal = inputVal - 32
}
return UiAction(inputVal)
}