Add hotkey evaluation

Targets #396.
I intend to rewrite the key caching and playback, so this is WIP.
Is there any reason why you do not return a errno.h number?