mirror of
https://github.com/br0xen/termbox-util.git
synced 2024-11-22 13:33:15 +00:00
Added alpha-numeric input tester
This commit is contained in:
parent
1c468454f6
commit
95d2a88a7c
@ -19,6 +19,18 @@ const (
|
|||||||
AlignRight
|
AlignRight
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/* Basic Input Helpers */
|
||||||
|
|
||||||
|
// KeyIsAlphaNumeric Returns whether the termbox event is an
|
||||||
|
// Alpha-Numeric Key Press
|
||||||
|
func KeyIsAlphaNumeric(event termbox.Event) {
|
||||||
|
k := event.Ch
|
||||||
|
if (k >= 'a' && k <= 'z') || (k >= 'A' && k <= 'Z') || (k >= '0' && k <= '9') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/* Basic Output Helpers */
|
/* Basic Output Helpers */
|
||||||
|
|
||||||
// DrawStringAtPoint Draw a string of text at x, y with foreground color fg, background color bg
|
// DrawStringAtPoint Draw a string of text at x, y with foreground color fg, background color bg
|
||||||
|
Loading…
Reference in New Issue
Block a user