Automatic keyboard detection

[endlessm/eos-shell#3425]
I try to always be in the habit of nulling out struct members when I free them. I'll keep it if it's optional to you.