Fix rare crash when Inventory key is set to a mouse button.  Fixes #469.