Rewrote KeyHandler

Signed-off-by: Zeldo Kavira <zeldokavira@gmail.com>