ui: convert key events to QKeyCodes immediately