keyboard support, starting with parent GH #1849 fleshed out

Do note that the keyboard scripting support is entirely unimplemented
and untested.