Only search once for a shortcut exactly matching the current modifiers, i.e. whether with or without COMMAND_KEY. Also clarify some of the comments and logic.