Background thread key event handling