Updated Keyboard Handler