Improve key modifiers handling.