Commit Graph

65 Commits

Author SHA1 Message Date
Florian Bruhin 1a4fff1a42 doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
Florian Bruhin 222f1f19a1 Bump copyright years
Closes #6015
2021-01-20 20:06:19 +01:00
Florian Bruhin 19586576c5 Revert "Work around PyQt 5.15.1 waitSignals issues"
This reverts commit b55675ad4a.
2020-11-24 18:48:19 +01:00
Florian Bruhin 1132324db9 old qt: Use ApplicationAttribute to switch Ctrl/Meta on Mac 2020-11-04 18:30:04 +01:00
Florian Bruhin b55675ad4a Work around PyQt 5.15.1 waitSignals issues
This should be reverted with PyQt 5.15.2.
See #5719
2020-09-15 13:56:00 +02:00
Florian Bruhin d6eebbd3f9 tests: Get rid of fake_keyevent
Use keyutils.KeyInfo(...).to_event() instead.
2020-06-17 16:00:23 +02:00
Florian Bruhin e9a23498b2 basekeyparser: Improve debug logging 2020-06-17 14:12:29 +02:00
Florian Bruhin ccc9d1779c modeparsers: Refactor to avoid subclassing
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.
2020-06-17 14:12:24 +02:00
Florian Bruhin 9e4276db9b Adjust copyrights for 2020 2020-01-04 18:21:17 +01:00
Florian Bruhin 7b2b977432 Move supports_count to a class attribute 2019-10-09 17:39:01 +02:00
Jay Kamat 3e816f5f8b
Update copyright for 2019 2019-02-22 21:45:08 -08:00
Florian Bruhin a458615030 Further simplify caplog.messages 2018-10-25 11:16:26 +02:00
Florian Bruhin 3b8964183e Use caplog.messages 2018-10-24 10:57:17 +02:00
Florian Bruhin 29ad252278 Handle ² keypress correctly
Turns out str.isdigit() also handles ² as a digit, but int('²') causes a
ValueError.

Here we use `string.digits` instead, which is '0123456789'.

Fixes #3743
2018-05-22 12:25:45 +02:00
Florian Bruhin 84c7c37e8e Swap Control/Meta back on macOS
Fixes #3697

(cherry picked from commit fd9e7bed7fd9842eac22ed304a094a92cc953577)
2018-03-14 19:40:56 +01:00
Florian Bruhin b88ac51d25 Fall back to non-keypad keys without any keypad bindings
Fixes #3701
2018-03-13 14:40:54 +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 0d94c17edc Apply key_mappings to KeySequences correctly
Fixes #3678
2018-03-06 21:39:57 +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 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 f85e69ec77 Refactor other keyinput 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 63e05e12ba Fix lint and tests 2018-03-04 20:21:57 +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 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 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 6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Florian Bruhin 1e2015be65 Make bindings win over mappings
Fixes #2995
2017-09-22 17:13:17 +02:00
Florian Bruhin ef1c83862b Use utils.is_* for platform checks everywhere 2017-09-20 11:10:24 +02:00
Florian Bruhin 1fc9817cd4 Remove support for ambiguous keybindings 2017-09-14 00:37:01 +02:00
Florian Bruhin d5cd0b19b0 Update test_basekeyparser for new config 2017-07-04 15:08:04 +02:00
Florian Bruhin ea2fbc427a tests: Use match= for pytest.raises 2017-05-23 09:36:00 +02:00
Florian Bruhin 822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin 552e0551af Revert zero counts
This initially seemed like a nice feature, but it means 0 can't be bound
as a separate key anymore, and 0<Esc> gives weird error messages...

Reverts #1953.
Fixes #2032.
2016-11-23 08:37:29 +01:00
Florian Bruhin c80f18522c Remove now-duplicate test
TestKeychain.test_count_0 now tests the exact same thing.
2016-09-30 18:17:28 +02:00
Florian Bruhin 28c87b5c6b Use right key in test_basekeyparser 2016-09-30 18:15:59 +02:00
Florian Bruhin 822c100f52 Make 0 a usable count for :tab-focus
Fixes #1768
2016-09-30 08:33:16 +02:00
Florian Bruhin df3733af54 tests: Use pytest.fixture instead of yield_fixture
See #1877
2016-08-22 07:40:24 +02:00
Florian Bruhin f4b72d4b24 Revert "Revert "Handle counts for special keys.""
This reverts commit 2d5ffbfd02.
2016-08-16 13:44:28 +02:00
Florian Bruhin 2d5ffbfd02 Revert "Handle counts for special keys."
This reverts commit c881730fad.

This is just a temporary solution until we can properly fix this.

See #1464
2016-04-29 14:20:11 +02:00