summaryrefslogtreecommitdiff
path: root/qutebrowser/keyinput
AgeCommit message (Collapse)Author
2022-04-01Store raw key in modeman.KeyEventqt6-testFlorian Bruhin
We don't know if this is a valid Qt.Key at this point. See #7045 and #7047
2022-03-31Ignore invalid keysFlorian Bruhin
Workaround for #7047, supersedes #7045
2021-11-13fix matching bindings with modifiersJimmy
Doing `Qt.Key | Qt.KeyboardModifier` now results in a QKeyCombination. append_event() always does that (even if the modifier is NoModifier). Previous hacks round this area: e61597ca817e369c95 (initial keyhack, partially corrected in this commit) 1cc87d4d47bc15754d (initial QKeyCombination introduction) ab447bd396b46247f6 (Earlier attempt at a fix, mostly corrected in this commit)
2021-10-03even more keypress related hacksJimmy
`QKeySequence.SequenceMatch` is one of the enums for which `Enum(0)` is no-longer falsey, compare to NoMatch instead. Otherwise the conditional is always false and forwarded keys don't work. Eg > from PyQt6.QtGui import QKeySequence, QKeyEvent > bool(QKeySequence.SequenceMatch.NoMatch) True > bool(QKeySequence.SequenceMatch(0)) True For `QKeySequence.SequenceMatch` and `QtCore.Qt.Key` and `QtCore.Qt.KeyboardModifier` int(enum_value) no longer works, eg > int(QtCore.Qt.KeyboardModifier(0)) TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'
2021-08-26More keyboard hacksFlorian Bruhin
2021-08-26key hacksFlorian Bruhin
2021-08-26API stuffFlorian Bruhin
2021-08-26enum pluralFlorian Bruhin
2021-08-26Invalid keyFlorian Bruhin
2021-08-26Automatically rewrite enumsFlorian Bruhin
See #5904
2021-08-26Blanket PyQt5 -> PyQt6Florian Bruhin
2021-07-12Revert "Fix enum stringification for Python 3.10 a7+"Florian Bruhin
This reverts commit e2c5fe6262564d9d85806bfa9d4486a411cf5045. See https://mail.python.org/archives/list/python-dev@python.org/thread/ZMC67QA2JVQJSWSFWRS6IM6ZX4EK277G/#LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF
2021-05-19mypy: Set disallow_any_genericsFlorian Bruhin
See #6100
2021-04-08Fix enum stringification for Python 3.10 a7+Florian Bruhin
https://bugs.python.org/issue40066 https://mail.python.org/archives/list/python-dev@python.org/message/CHQW6THTDYNPPFWQ2KDDTUYSAJDCZFNP/ https://github.com/python/cpython/commit/b775106d940e3d77c8af7967545bb9a5b7b162df
2021-03-20Fix bindings.key_mappings with multiple keysFlorian Bruhin
Otherwise, when e.g. doing "<Meta+Up>": "gg" in bindings.key_mappings, there's a crash like: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/eventfilter.py", line 105, in eventFilter return handler(typing.cast(QKeyEvent, event)) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/eventfilter.py", line 75, in _handle_key_event return man.handle_event(event) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/modeman.py", line 462, in handle_event return handler(cast(QKeyEvent, event)) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/modeman.py", line 283, in _handle_keypress match = parser.handle(event, dry_run=dry_run) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/modeparsers.py", line 105, in handle match = super().handle(e, dry_run=dry_run) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/basekeyparser.py", line 309, in handle result = self._match_key_mapping(result.sequence) File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/basekeyparser.py", line 246, in _match_key_mapping mapped = sequence.with_mappings( File "/usr/lib/python3.9/site-packages/qutebrowser/keyinput/keyutils.py", line 675, in with_mappings assert len(new_seq) == 1 AssertionError While this isn't the intended way to use this setting, we shouldn't crash - and let's just make it work instead of forbidding it.
2021-03-18Merge branch 'master' into dev-split-parserFlorian Bruhin
2021-03-11Revert "Add deprecated aliases for renamed commands"Florian Bruhin
This reverts commit 8976e6850317881ed1aebed55a273e73c17a50bd.
2021-03-09Add log-sensitive-keys debug flagFlorian Bruhin
2021-03-03Merge remote-tracking branch 'origin/pr/5967' into devFlorian Bruhin
2021-02-24Update changelog/commentFlorian Bruhin
2021-02-24Revert "old qt: Use ApplicationAttribute to switch Ctrl/Meta on Mac"Florian Bruhin
This reverts commit 1132324db9d665ba0f0143fb1d071995a3fc7715. Causes various issues with Qt/QtWebEngine shortcuts. Fixes #6174 Closes #6149
2021-02-03Revert "Pass through keys when a context menu is open"Florian Bruhin
This reverts commit 708a7630e78251e9df9ae2b69796bad6c88ae7af.
2021-02-03Pass through keys when a context menu is openFlorian Bruhin
2021-01-27Add deprecated aliases for renamed commandsFlorian Bruhin
See #6022, #6071
2021-01-26doc: Switch URLs to httpsFlorian Bruhin
2021-01-22Support Super as modifier nameFlorian Bruhin
See https://github.com/qutebrowser/qutebrowser/discussions/5999#discussioncomment-297309
2021-01-20Bump copyright yearsFlorian Bruhin
Closes #6015
2021-01-20Rename :enter-mode and :leave-modeFlorian Bruhin
See #6022
2021-01-20Rename :run-macro and :record-macroFlorian Bruhin
See #6022
2021-01-13dataclasses: Adjust import orderFlorian Bruhin
See #6023
2021-01-13dataclasses: Fix orderingFlorian Bruhin
See #6023
2021-01-13dataclasses: Initial switchFlorian Bruhin
See #6023
2021-01-11Add objects.qapp to avoid needing to None-checkFlorian Bruhin
We know that QApplication.instance() will always be non-None for practical purposes, but the stubs now (correctly) declare it as Optional. See https://github.com/stlehmann/PyQt5-stubs/pull/126
2021-01-03Fix PR issues for set-cmd-text completions.Ryan Roden-Corrent
- Prefer None to "" - Prefer implicit bool checking - Try to fix mypy warnings
2020-11-04old qt: Set _SPECIAL_NAMES in keyutils directlyFlorian Bruhin
The last addition to Qt.Key is included in 5.12.0: Ib5c37168990c9d9fa99fdd50f63b934c793e8dc
2020-11-04old qt: Use ApplicationAttribute to switch Ctrl/Meta on MacFlorian Bruhin
2020-11-04old qt: Remove KeyInfo.__hash__Florian Bruhin
2020-11-02mypy: use annotations for typing instead of commentsTim Brown
2020-10-28mypy: use from-import style for typingTim Brown
Update files in `keyinput`, `mainwindow`, and `misc`. See #5396
2020-10-26Use enum.auto() for most enum valuesFlorian Bruhin
Doesn't change values where they are chosen to line up with Qt enums. See #4800
2020-10-16Use signals to set status text from HintManagerFlorian Bruhin
2020-10-16Add/improve docs for enumsFlorian Bruhin
2020-10-09Use class-based API instead of functions for enumsYegor
2020-07-27Disallow register mode for :enter-modeFlorian Bruhin
2020-06-17Fix lintFlorian Bruhin
2020-06-17Show partial keystrings for all modes in statusbarFlorian Bruhin
Closes #2817
2020-06-17Add BindingTrie.__str__Florian Bruhin
2020-06-17modeparsers: Refactor how hints are handledFlorian Bruhin
Instead of binding hints to fake :follow-hint commands, we now use a separate CommandKeyParser and ask that for its match result. If the key matches with the command parser, it is bound in hint mode, so we clear the hint keystring and defer to the command handling instead. If it doesn't, we continue hint handling as usual - however, the HintKeyParser is now not a CommandKeyParser anymore, so we don't have to deal with command parsing (and have a custom execute implementation instead). Closes #4504 Fixes #4392 Fixes #4368 Helps with #5084, though it doesn't completely fix that yet. Supersedes #3742 (fix for #3735) Supersedes #4691 (fix for #4264)
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.