support alpha, numeric, f0..10, punctuation, math keys
parent
9ce50f2622
commit
6536daee7f
|
|
@ -34,6 +34,9 @@ Think Dug's Twitch Chat Plays
|
||||||
|
|
||||||
Each client needs 1 executable and 1 env file with a unique set of buttons
|
Each client needs 1 executable and 1 env file with a unique set of buttons
|
||||||
|
|
||||||
|
> 10 buttons per player
|
||||||
|
> `go doc key Undef | grep Key | grep -v Undef | wc -l` total (54)
|
||||||
|
|
||||||
The server cannot be a client because math. Maybe a VM on the client as a server would work tho.
|
The server cannot be a client because math. Maybe a VM on the client as a server would work tho.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,24 @@ var (
|
||||||
'8': N8,
|
'8': N8,
|
||||||
'9': N9,
|
'9': N9,
|
||||||
'0': N0,
|
'0': N0,
|
||||||
|
'!': F1,
|
||||||
|
'@': F2,
|
||||||
|
'#': F3,
|
||||||
|
'$': F4,
|
||||||
|
'%': F5,
|
||||||
|
'^': F6,
|
||||||
|
'&': F7,
|
||||||
|
'*': F8,
|
||||||
|
'(': F9,
|
||||||
|
')': F10,
|
||||||
|
',': PComma,
|
||||||
|
'.': PPeriod,
|
||||||
|
'/': PFSlash,
|
||||||
|
';': PSemicolon,
|
||||||
|
'[': POpenBracket,
|
||||||
|
']': PCloseBracket,
|
||||||
|
'-': PMinus,
|
||||||
|
'=': PEqual,
|
||||||
}
|
}
|
||||||
keyToChar = func() map[Key]byte {
|
keyToChar = func() map[Key]byte {
|
||||||
result := map[Key]byte{}
|
result := map[Key]byte{}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ func TestFromChar(t *testing.T) {
|
||||||
if got := FromChar('A'); got != A {
|
if got := FromChar('A'); got != A {
|
||||||
t.Error(got)
|
t.Error(got)
|
||||||
}
|
}
|
||||||
if got := FromChar('!'); got != Undef {
|
if got := FromChar(byte(0)); got != Undef {
|
||||||
t.Error(got)
|
t.Error(got)
|
||||||
}
|
}
|
||||||
if got := ToChar(A); got != 'a' {
|
if got := ToChar(A); got != 'a' {
|
||||||
|
|
|
||||||
|
|
@ -42,4 +42,22 @@ const (
|
||||||
N8 = Key(keybd_event.VK_8)
|
N8 = Key(keybd_event.VK_8)
|
||||||
N9 = Key(keybd_event.VK_9)
|
N9 = Key(keybd_event.VK_9)
|
||||||
N0 = Key(keybd_event.VK_0)
|
N0 = Key(keybd_event.VK_0)
|
||||||
|
F1 = Key(keybd_event.VK_F1)
|
||||||
|
F2 = Key(keybd_event.VK_F2)
|
||||||
|
F3 = Key(keybd_event.VK_F3)
|
||||||
|
F4 = Key(keybd_event.VK_F4)
|
||||||
|
F5 = Key(keybd_event.VK_F5)
|
||||||
|
F6 = Key(keybd_event.VK_F6)
|
||||||
|
F7 = Key(keybd_event.VK_F7)
|
||||||
|
F8 = Key(keybd_event.VK_F8)
|
||||||
|
F9 = Key(keybd_event.VK_F9)
|
||||||
|
F10 = Key(keybd_event.VK_F10)
|
||||||
|
PComma = Key(keybd_event.VK_COMMA)
|
||||||
|
PPeriod = Key(keybd_event.VK_Period)
|
||||||
|
PFSlash = Key(keybd_event.VK_BACKSLASH)
|
||||||
|
PSemicolon = Key(keybd_event.VK_SEMICOLON)
|
||||||
|
POpenBracket = Key(keybd_event.VK_LeftBracket)
|
||||||
|
PCloseBracket = Key(keybd_event.VK_RightBracket)
|
||||||
|
PMinus = Key(keybd_event.VK_MINUS)
|
||||||
|
PEqual = Key(keybd_event.VK_EQUAL)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue