1
0
mirror of https://github.com/br0xen/termbox-util.git synced 2024-11-22 21:43:14 +00:00

Adding Alpha-Numeric Tester

This commit is contained in:
Brian Buller 2015-12-28 22:19:08 -06:00
parent 95d2a88a7c
commit c5ed6dc0ba

View File

@ -23,7 +23,7 @@ const (
// KeyIsAlphaNumeric Returns whether the termbox event is an // KeyIsAlphaNumeric Returns whether the termbox event is an
// Alpha-Numeric Key Press // Alpha-Numeric Key Press
func KeyIsAlphaNumeric(event termbox.Event) { func KeyIsAlphaNumeric(event termbox.Event) bool {
k := event.Ch k := event.Ch
if (k >= 'a' && k <= 'z') || (k >= 'A' && k <= 'Z') || (k >= '0' && k <= '9') { if (k >= 'a' && k <= 'z') || (k >= 'A' && k <= 'Z') || (k >= '0' && k <= '9') {
return true return true