summaryrefslogtreecommitdiff
path: root/qutebrowser/keyinput/basekeyparser.py
AgeCommit message (Collapse)Author
2022-03-31Ignore invalid keysFlorian Bruhin
Workaround for #7047, supersedes #7045
2021-08-26key hacksFlorian Bruhin
2021-08-26Automatically rewrite enumsFlorian Bruhin
See #5904
2021-08-26Blanket PyQt5 -> PyQt6Florian Bruhin
2021-05-19mypy: Set disallow_any_genericsFlorian Bruhin
See #6100
2021-01-26doc: Switch URLs to httpsFlorian Bruhin
2021-01-20Bump copyright yearsFlorian Bruhin
Closes #6015
2021-01-13dataclasses: Adjust import orderFlorian Bruhin
See #6023
2021-01-13dataclasses: Initial switchFlorian Bruhin
See #6023
2020-10-28mypy: use from-import style for typingTim Brown
Update files in `keyinput`, `mainwindow`, and `misc`. See #5396
2020-06-17Fix lintFlorian Bruhin
2020-06-17Add BindingTrie.__str__Florian Bruhin
2020-06-17basekeyparser: Improve debug loggingFlorian Bruhin
2020-06-17modeparsers: Refactor to avoid subclassingFlorian Bruhin
Before the changes in this commit, we've had to have a subclassed parser for every mode, even if there was no special key handling going on in that mode. With a couple of changes, we can avoid many of those subclasses and only have subclasses for bigger changes (like hint or register modes). - The awkward handling of self._modename in _read_config() is now removed. _read_config() doesn't take an argument, always uses the mode in self._mode and gets called from __init__. - BaseKeyParser takes the mode as an argument to __init__. - The class attributes (do_log/passthrough/supports_count) now also get passed via the constructor.
2020-06-17basekeyparser: Remove old config format commentFlorian Bruhin
2020-05-10Fix lintFlorian Bruhin
See #5368
2020-05-09mypy: Fix wrong type annotationsFlorian Bruhin
See #5368
2020-03-21Upgrade to mypy 0.770Florian Bruhin
This removes some isinstance asserts which are outdated. Mypy should be able to alert us in those cases anyways.
2020-01-04Adjust copyrights for 2020Florian Bruhin
2019-10-10Fix hint filtering with number keypadFlorian Bruhin
In 9557885 a regression was introduced which broke following hints with the number keypad. Fixes #5065
2019-10-09Complete type annotations for keyinput.basekeyparserFlorian Bruhin
2019-10-09Move supports_count to a class attributeFlorian Bruhin
2019-09-13Remove BindingTrie.__getitem__Florian Bruhin
2019-09-13Add a proper MatchResult type instead of tuplesFlorian Bruhin
2019-09-12Rename BindingTrie.child to childrenFlorian Bruhin
2019-09-12Improve docstringsFlorian Bruhin
2019-09-12Add some more type safety for keyutilsFlorian Bruhin
We now convert from int to Qt.Key as soon as we get a key (with no modifiers added) from a QKeyEvent. Also add missing _assert_plain_key calls.
2019-09-12Add more type annotations for basekeyparser.pyFlorian Bruhin
2019-09-12Don't claim that BindingTrie is a MutableMappingFlorian Bruhin
While we need to implement update/__contains__ by hand, I think this is a much cleaner solution because we aren't actually a MutableMapping if we don't implement __delitem__/__iter__/__len__. See https://refactoring.guru/smells/refused-bequest
2019-09-12Make KeyInfo hashableFlorian Bruhin
This way, we can store the real KeyInfo objects in BindingTrie instead of having to use .to_int().
2019-09-12Merge remote-tracking branch 'origin/pr/4730' into binding-trieFlorian Bruhin
2019-05-03Remove pylint useless suppressionuser202729
2019-04-23Implement trie for bindingsuser202729
2019-03-17Cache bindings.key_mappingsJay Kamat
2019-02-22Update copyright for 2019Jay Kamat
2018-05-22Handle ² keypress correctlyFlorian Bruhin
Turns out str.isdigit() also handles ² as a digit, but int('²') causes a ValueError. Here we use `string.digits` instead, which is '0123456789'. Fixes #3743
2018-03-13Split up BaseKeyParser.handle into functionsFlorian Bruhin
2018-03-13Fall back to non-keypad keys without any keypad bindingsFlorian Bruhin
Fixes #3701
2018-03-07Show the keystring correctly when entering a countFlorian Bruhin
2018-03-07Allow to bind numbers in keybindingsFlorian Bruhin
This mostly reverts 4ef5db1bc4b5205812714a57d29daa59224afe8b for #1966, but fixes #3684 by allowing numbers to be bound again. If the user wants to bind numbers instead of using them for a count, why not let them.
2018-03-06Apply key_mappings to KeySequences correctlyFlorian Bruhin
Fixes #3678
2018-03-05Also log modifiers for key pressesFlorian Bruhin
2018-03-05Fix lintFlorian Bruhin
2018-03-05Handle invalid keys coming from QtFlorian Bruhin
When pressing a key which doesn't exist as Qt.Key, we don't get Qt.Key_unknown like we'd expect, but we get 0x0 instead... Let's add that as a new "nil" key (to not conflict with None/unknown/zero/...) and handle it appropriately. This can be reproduced by doing: setxkbmap -layout us,gr -option grp:alt_shift_toggle and pressing Alt-Shift/Shift-Alt.
2018-03-05Filter out ShortcutOverride events properlyFlorian Bruhin
Fixes #3419
2018-03-04Always prefer exact over partial matchesFlorian Bruhin
2018-03-04Improve logging message for clear_keystringFlorian Bruhin
2018-03-04Fix handling of key_mappingsFlorian Bruhin
2018-03-04Bring back keyutils.is_modifier() and modifier handlingFlorian Bruhin
Turns out when we press yY, we get three events: Qt.Key_Y, Qt.NoModifier Qt.Key_Shift, Qt.ShiftModifier Qt.Key_Y, Qt.ShiftModifier If we don't ignore the second one, our keychain will be interrupted by the Shift keypress.
2018-03-04Simplify handling of modifier-only keysFlorian Bruhin
Now that we don't rely on str(KeyInfo) being empty anywhere, there's no reason to return an empty string for only-modifier keypresses anymore. While those keys can't be bound (QKeySequence('Shift') == Qt.Key_unknown) there's also no reason to explicitly ignore them.