improved shortcut key handling and key parsing