Added prevState parameter to think function.
Added keys to keyboard struct.
Added key events.
Changed test code a bit.