Fixes #1919: Shortcuts keys for inverting values don't work correctly wi...

This should be a better fix than #1930. @davxlw verification needed.

I see the problem, but I fear the solution will be ugly. Let me see...