first commit, uses global variable for keyboard event handler instead of cgo callback craziness