Clear key chains when a special key is pressed in hint mode

When we press "s<Escape>", we don't want <Escape> to be handled as part of a key
chain.
This commit is contained in:
Florian Bruhin 2018-03-09 08:36:37 +01:00
parent 66b06ed84c
commit c7cccf4ba0

View File

@ -259,9 +259,18 @@ class HintKeyParser(CommandKeyParser):
Returns:
True if the match has been handled, False otherwise.
"""
match = super().handle(e, dry_run=dry_run)
dry_run_match = super().handle(e, dry_run=True)
if dry_run:
return match
return dry_run_match
if (not keyutils.is_printable(e.key()) and
dry_run_match == QKeySequence.NoMatch):
log.keyboard.debug("Got special key, clearing keychain")
self.clear_keystring()
assert not dry_run
match = super().handle(e)
if match == QKeySequence.PartialMatch:
self._last_press = LastPress.keystring