Fixed a bug with keyboard  listeners