Fixes keyboard events