Prevent key events without key code from triggering actions (#11029)

Seemingly not possible to auto-test reliably

Change-Id: Idb492465323d91279caf170646590a54847b9414