Automatic keyboard detection

[endlessm/eos-shell#3425]
I recommend making both this and the struct below `typedef`s