refactored keyboard handling support for first responders