summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-06-18 14:59:53 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-08-23 18:31:42 +0200
commit5b3585805ed666a47de88403276a1280afab32c0 (patch)
treecad9c6c26d4967a9f3cb46fb786a2a5043036177
parenta46b09f9bc3fdb2ef79070a771f47e0dcfb5ccc1 (diff)
downloadqutebrowser-5b3585805ed666a47de88403276a1280afab32c0.tar.gz
qutebrowser-5b3585805ed666a47de88403276a1280afab32c0.zip
Revert "wip: Work around PyQt snapshot enum weirdness"
This reverts commit 400dbc8de3139d2a7015bcf58f14e56c46f3bdb9.
-rw-r--r--qutebrowser/keyinput/keyutils.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py
index e79e1105d..ce9c10dbc 100644
--- a/qutebrowser/keyinput/keyutils.py
+++ b/qutebrowser/keyinput/keyutils.py
@@ -204,7 +204,7 @@ def _is_surrogate(key: Qt.Key) -> bool:
(Base Multilingual Plane).
"""
_assert_plain_key(key)
- return 0xd800 <= qtutils.extract_enum_val(key) <= 0xdfff
+ return 0xd800 <= key <= 0xdfff
def _remap_unicode(key: Qt.Key, text: str) -> Qt.Key:
@@ -252,12 +252,11 @@ def _key_to_string(key: Qt.Key) -> str:
A name of the key as a string.
"""
_assert_plain_key(key)
- val = qtutils.extract_enum_val(key)
- if val in _SPECIAL_NAMES:
- return _SPECIAL_NAMES[val]
+ if key in _SPECIAL_NAMES:
+ return _SPECIAL_NAMES[key]
- result = QKeySequence(val).toString()
+ result = QKeySequence(key).toString()
_check_valid_utf8(result, key)
return result