Fix OS X keys handling