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
Florian Bruhin
af6e5b1838
Fix lint
2018-03-04 20:21:57 +01:00
Florian Bruhin
fac8d72d8c
Capitalize Escape in TestFullscreenNotification
2018-03-04 20:21:57 +01:00
Florian Bruhin
a57fc5c746
Refactor keyutils tests involving all keys
2018-03-04 20:21:57 +01:00
Florian Bruhin
4223e2f85d
Check all keys against QTest::keyToAscii
2018-03-04 20:21:57 +01:00
Fritz Reichwald
d28c323074
Add printable and ismodifier test
2018-03-04 20:21:57 +01:00
Florian Bruhin
934d586286
Fix handling of Shift-Tab aka. Backtab
2018-03-04 20:21:57 +01:00
Florian Bruhin
63e05e12ba
Fix lint and tests
2018-03-04 20:21:57 +01:00
Florian Bruhin
2ca15d7667
Add tests for lower-/uppercase text
2018-03-04 20:20:31 +01:00
Florian Bruhin
8c87040cb6
Improve IDs for qt_key fixture
2018-03-04 20:20:31 +01:00
Florian Bruhin
0b6d2c2b0a
Make all key names work
2018-03-04 20:20:30 +01:00
Florian Bruhin
601e56d2fa
Make test_keyutils work
2018-03-04 20:20:30 +01:00
Florian Bruhin
8f479407a0
key_data: Update key names to reflect reality
...
Generated by:
import key_data
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeySequence
for key in key_data.KEYS:
attr = key.attribute
member = getattr(Qt, 'Key_' + attr, None)
if member is None:
continue
name = QKeySequence(member).toString()
if name != attr:
try:
print(" Key('{}', '{}')".format(attr, name))
except UnicodeEncodeError:
print(" Key('{}', '{}') # FIXME".format(attr, name.encode('unicode-escape').decode('ascii')))
else:
print()
2018-03-04 20:20:30 +01:00
Florian Bruhin
f714be0ff7
Initial tests on all Qt keys
2018-03-04 20:20:30 +01:00
Florian Bruhin
19512e988b
Expose less from keyutils publicly
2018-03-04 20:20:30 +01:00
Florian Bruhin
fdc2458657
Fix test_split_count after _handle_key merge
2018-03-04 20:20:30 +01:00
Florian Bruhin
c3485821c7
Adjust copyright
2018-03-04 20:20:30 +01:00
Florian Bruhin
5a5873d4ee
Rename KeyConfig._prepare to ._validate
2018-02-27 14:16:41 +01:00
Florian Bruhin
49d297f7bf
Fix tests for parsing KeySequences
2018-02-27 14:10:55 +01:00
Florian Bruhin
244590f49d
Handle unknown keys with :bind/:unbind
2018-02-27 13:09:48 +01:00
Florian Bruhin
88b5007457
Consolidate invalid :bind/:unbind tests
2018-02-27 13:02:32 +01:00
Florian Bruhin
8090d3e289
Handle invalid keys in config.py
2018-02-27 13:02:32 +01:00
Florian Bruhin
898f5c50c4
Add a test for utils.chunk
2018-02-27 13:02:32 +01:00
Florian Bruhin
ec3ad8a969
Get rid of _warn_on_keychains and _supports_chains
2018-02-27 13:02:32 +01:00
Florian Bruhin
ba012c6ba8
Get rid of BaseKeyparser.Type
2018-02-27 13:01:41 +01:00
Florian Bruhin
362f923f06
Fix lint
2018-02-27 09:34:55 +01:00
Florian Bruhin
1ba61bbcbe
Fix test_modeparsers
2018-02-27 09:22:01 +01:00
Florian Bruhin
911b2daebf
Fix test_keyutils
2018-02-27 09:07:20 +01:00
Florian Bruhin
5a03d31f6f
More test_basekeyparser fixes
2018-02-27 08:53:28 +01:00
Florian Bruhin
9e27f2b3e7
Initial attempts at fixing test_basekeyparser
2018-02-27 08:48:16 +01:00
Florian Bruhin
1e8f72dfe6
Adjust test_configtypes
2018-02-27 08:10:54 +01:00
Florian Bruhin
f40f4082ba
Validate configtypes.Key correctly
2018-02-27 07:56:34 +01:00
Florian Bruhin
612387633d
Adjust test_configfiles
2018-02-27 07:53:29 +01:00