make key events work on ruby 1.9
Merge pull request #1 from chad/ruby_19_compatibility

make key events work on ruby 1.9