Commit Graph

4058 Commits

Author SHA1 Message Date
Florian Bruhin
ebb373ccad Make sure keys with modifiers get handled as special 2018-03-09 09:04:28 +01:00
Florian Bruhin
66b06ed84c Add first tests for HintKeyParser 2018-03-09 07:38:16 +01:00
Florian Bruhin
482b622b1b Fix handling of empty bindings without breaking :unbind
1899e313fd as a fix for #3631 broke :unbind, as
the config system treats None and '' equally.

Instead, allow None/'' again, but just handle it as "no binding".
2018-03-08 11:42:27 +01:00
Florian Bruhin
d5c04318b2 Fix test/lint 2018-03-08 06:41:15 +01:00
Florian Bruhin
9b9d7647a4 Show the keystring correctly when entering a count 2018-03-07 22:47:31 +01:00
Florian Bruhin
514138aad2 Allow to bind numbers in keybindings
This mostly reverts 4ef5db1bc4 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-07 22:37:10 +01:00
Florian Bruhin
34815f5cf8 Make bindings.default only settable in autoconfig.yml
Fixes #3131
2018-03-07 18:30:44 +01:00
Florian Bruhin
8a60855b88 Fix lint 2018-03-06 21:44:37 +01:00
Florian Bruhin
0d94c17edc Apply key_mappings to KeySequences correctly
Fixes #3678
2018-03-06 21:39:57 +01:00
Florian Bruhin
db7ccb0434 Update config tests for pattern changes 2018-03-06 13:26:22 +01:00
Florian Bruhin
06bccfeb78 Improve error message for QtWebEngine inspector 2018-03-06 12:57:38 +01:00
Florian Bruhin
69a58c9597 Remove Qt 5.8 support and tests
With QtWebKit it's probably okay to still use it (*cough* Hyperbola
GNU/Linux-libre^tm *cough*), and only blacklisting it with QtWebEngine would be
quite some effort.

Fixes #3608
2018-03-06 11:04:59 +01:00
Florian Bruhin
257753841b Allow lightweight URL patterns without a scheme
See #3622
2018-03-06 10:33:55 +01:00
Florian Bruhin
7fc53ae78a Make path optional in URL patterns
See #3622
2018-03-06 09:45:06 +01:00
Florian Bruhin
8c0bca90d3 Merge remote-tracking branch 'origin/pr/3456' 2018-03-06 09:32:39 +01:00
Florian Bruhin
0e2a39da2a Fix tests for keyboard parsing change 2018-03-06 07:39:41 +01:00
Florian Bruhin
41dfa29648 Improve parsing of invalid keys
This should handle "<>" and "\x1f" correctly.
2018-03-06 06:29:38 +01:00
Florian Bruhin
7a9f8fda72 Get rid of unnecessary lambda 2018-03-05 23:07:03 +01:00
Florian Bruhin
2b84ea9dbe Make sure we have plain keys/modifiers where needed 2018-03-05 23:01:24 +01:00
Florian Bruhin
0ee7fac727 Update test_init_unknown/test_init_invalid for KeyboardModifierMask
-1 & Qt.KeyboardModifierMask == Qt.Key_unknown
2018-03-05 22:56:58 +01:00
Florian Bruhin
8deb38e22d Add test for :bind completion with invalid binding 2018-03-05 22:21:57 +01:00
Florian Bruhin
29fdd1acc4 Make sure all keyboard modifiers are handled correctly
This handles Qt.KeypadModifier (Num+...) correctly, adds tests for converting
modifiers to strings, and strips Qt.GroupSwitchModifier as QKeySequence doesn't
know about it.

Fixes #3675
2018-03-05 22:11:26 +01:00
Florian Bruhin
333a37ffb2 Fix old macOS-specific test code 2018-03-05 18:30:34 +01:00
Florian Bruhin
d1854eddaf Handle invalid keys coming from Qt
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-05 15:42:52 +01:00
Florian Bruhin
52c280ec12 Add unit tests for BaseKeyParser.handle with dry_run=True 2018-03-05 15:33:56 +01:00
Florian Bruhin
67b4502fdb Fix test_version without cssutils 2018-03-05 11:36:50 +01:00
Florian Bruhin
2f8686ec70 Fix test_mhtml_e2e with Qt 5.11
See #3661
2018-03-05 11:36:29 +01:00
Florian Bruhin
cc5da4d1fe Fix test_modeman.py 2018-03-05 11:08:21 +01:00
Florian Bruhin
b4a2352833 Cache HTML/JS resource files when starting
This mostly reverts 9edc5a665e (see #1362).
Fixes #1943
2018-03-05 09:08:06 +01:00
Florian Bruhin
274f2a9d19 Rename eventFilter methods in modeman 2018-03-05 06:36:01 +01:00
Florian Bruhin
4ef5db1bc4 Disallow numbers in keybindings
Fixes #1966
2018-03-04 23:17:51 +01:00
Florian Bruhin
155a1901c0 Merge branch 'keys' 2018-03-04 22:50:41 +01:00
Florian Bruhin
88a5c8d29d Make sure bindings with umlauts work
See #303
2018-03-04 22:38:33 +01:00
Florian Bruhin
e2f17c4be1 Always prefer exact over partial matches 2018-03-04 21:45:46 +01:00
Florian Bruhin
0967b6abd2 Fix handling of </> keys 2018-03-04 20:40:16 +01:00
Florian Bruhin
d8bfe23c0d Fix lint 2018-03-04 20:21:58 +01:00
Florian Bruhin
f85e69ec77 Refactor other keyinput tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
2be7db29ed 100% coverage for keyinput.keyutils 2018-03-04 20:21:58 +01:00
Florian Bruhin
8da878c77c Make KeySequence.matchs() work correctly 2018-03-04 20:21:58 +01:00
Florian Bruhin
866c758660 Add more KeySequence tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
fb7c75a090 Improve keyutils tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
3c9e8ff9ab Test and fix keyutils._parse_keystring 2018-03-04 20:21:58 +01:00
Florian Bruhin
7f8508a367 Change the way Space keybindings are handled
Using it as " " in a keystring won't work anymore, but instead <Space> and
<Shift-Space> does.
2018-03-04 20:21:58 +01:00
Florian Bruhin
da60d11b24 Refactor keyutils tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
b3834835ed Bring back keyutils.is_modifier() and modifier handling
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-04 20:21:58 +01:00
Florian Bruhin
e306e2dadb Improve and fix test_is_printable 2018-03-04 20:21:58 +01:00
Fritz Reichwald
d9a88e139c Test for modifiers and corner case 0xFF 2018-03-04 20:21:58 +01:00
Florian Bruhin
3a11a24be0 Fix modifier handling
We don't want to show <Shift-Shift>, but <Ctrl-Shift> should still work
correctly.
2018-03-04 20:21:58 +01:00
Florian Bruhin
7cb781cc92 Simplify handling of modifier-only keys
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.
2018-03-04 20:21:57 +01:00
Florian Bruhin
693178c8ee Refactor KeyInfo.__str__
This removes the special handling for macOS, but this is hopefully not needed
anymore as we don't compare strings.
2018-03-04 20:21:57 +01:00