diff options
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/keyinput/keyutils.py | 4 | ||||
-rw-r--r-- | qutebrowser/keyinput/modeman.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index 7d043d556..db3fb2a0d 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -427,7 +427,7 @@ class KeyInfo: def to_int(self) -> int: """Get the key as an integer (with key/modifiers).""" - return int(self.key) | int(self.modifiers) + return self.key | self.modifiers.value class KeySequence: @@ -463,6 +463,8 @@ class KeySequence: """Convert a single key for QKeySequence.""" #assert isinstance(key, (int, Qt.KeyboardModifier)), key #return int(key) + if isinstance(key, int): + return key return key.key() def __str__(self) -> str: diff --git a/qutebrowser/keyinput/modeman.py b/qutebrowser/keyinput/modeman.py index e59964432..53f7354c8 100644 --- a/qutebrowser/keyinput/modeman.py +++ b/qutebrowser/keyinput/modeman.py @@ -24,7 +24,7 @@ import dataclasses from typing import Mapping, Callable, MutableMapping, Union, Set, cast from PyQt6.QtCore import pyqtSlot, pyqtSignal, Qt, QObject, QEvent -from PyQt6.QtGui import QKeyEvent +from PyQt6.QtGui import QKeySequence, QKeyEvent from qutebrowser.commands import runners from qutebrowser.keyinput import modeparsers, basekeyparser @@ -296,7 +296,7 @@ class ModeManager(QObject): forward_unbound_keys = config.cache['input.forward_unbound_keys'] - if match: + if match != QKeySequence.SequenceMatch.NoMatch: filter_this = True elif (parser.passthrough or forward_unbound_keys == 'all' or (forward_unbound_keys == 'auto' and is_non_alnum)): |