Keyboard events now make sense

Letter states are unified for capital and lower cases.
Shift and Control now consider both of their keys when determining their state.
Added range checks for array accesses.
Use new #defines for key IDs
Fixed several compiler warnings.