-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite of event engine #307
Open
boppreh
wants to merge
26
commits into
master
Choose a base branch
from
suppress4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Mar 31, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 27d9d05 - Browse repository at this point
Copy the full SHA 27d9d05View commit details
Commits on Apr 1, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e53822f - Browse repository at this point
Copy the full SHA e53822fView commit details
Commits on Apr 2, 2018
-
Finish third iteration of suppression code
The first version that could suppress events was introduced by @xoviat via #38. It was a separate module, using nested dictionaries to simulate a state machine that had to be updated on every hotkey registered. It also handled the entire hotkey process, including multi-steps and timeouts. It was very complex, and had some bugs that we weren't sure were fixable with that architecture. The second version was developed in the `suppress` branch for over an year. It used an explicit state machine for each key, divided by several attributes (is it a modifier, was it processed by a key, etc). It processed only single-step hotkeys. Multi-step hotkeys were simulated by adding and removing hotkeys as necessary, and keeping track separately of which events were suppressed from previous steps. This version worked better, with fewer bugs and somewhat simpler, but the execution was still hard to understand and some bugs were creeping in. This commit introduces the third attempt at making a resiliant and simple to understand key event suppression system. It borrows the concept of multi-step hotkeys as being sequences of single-step hotkeys, but revamps everything else. The meat of the code is a set of global variables and a decision tree. The decision tree is executed for each incoming event, and uses the global state to decide if a given event should be: 1) Suppressed. It's part of a blocking hotkey and at least one callback returned False. The event is blocked with no hope of recovery. For key down events, the corresponding key up event will also be suppressed. 2) Delayed. This event is part of a *subset* of one or more blocking hotkeys. We block it now, but may decide to resend it later. 3) Allowed. The event is passed along normally. If there were any pending events, they are resent before allowing this one. The global variables keep track of which keys the OS reports as currently pressed (i.e. physically pressed keys), which keys were allowed to be passed (i.e. logically pressed keys, from the point of view of other applications), which key presses have been tentatively suppressed, and which key presses were definitely suppressed by hotkeys. It's still complex, but much easier to understand than the two previous versions, doesn't have the same bugs (I hope it has no bugs at all), and is much easier to debug and amend. Third time is the charm, wish me luck.
Configuration menu - View commit details
-
Copy full SHA for d3439be - Browse repository at this point
Copy the full SHA d3439beView commit details
Commits on May 18, 2018
-
Configuration menu - View commit details
-
Copy full SHA for a5d81fb - Browse repository at this point
Copy the full SHA a5d81fbView commit details
Commits on Jun 7, 2018
-
Configuration menu - View commit details
-
Copy full SHA for a4e60db - Browse repository at this point
Copy the full SHA a4e60dbView commit details
Commits on Aug 14, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 7ee721c - Browse repository at this point
Copy the full SHA 7ee721cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a87014 - Browse repository at this point
Copy the full SHA 2a87014View commit details -
Configuration menu - View commit details
-
Copy full SHA for e717860 - Browse repository at this point
Copy the full SHA e717860View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1bfdac - Browse repository at this point
Copy the full SHA d1bfdacView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d6b220 - Browse repository at this point
Copy the full SHA 7d6b220View commit details
Commits on Aug 15, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 213ee14 - Browse repository at this point
Copy the full SHA 213ee14View commit details -
Configuration menu - View commit details
-
Copy full SHA for a96f075 - Browse repository at this point
Copy the full SHA a96f075View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb594e8 - Browse repository at this point
Copy the full SHA fb594e8View commit details
Commits on Aug 16, 2018
-
Configuration menu - View commit details
-
Copy full SHA for b0ad839 - Browse repository at this point
Copy the full SHA b0ad839View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e793fe - Browse repository at this point
Copy the full SHA 8e793feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c272aa - Browse repository at this point
Copy the full SHA 0c272aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bf33f8 - Browse repository at this point
Copy the full SHA 9bf33f8View commit details
Commits on Sep 5, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 7bfbf60 - Browse repository at this point
Copy the full SHA 7bfbf60View commit details -
Configuration menu - View commit details
-
Copy full SHA for c498b3e - Browse repository at this point
Copy the full SHA c498b3eView commit details
Commits on Oct 22, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e55daf8 - Browse repository at this point
Copy the full SHA e55daf8View commit details
Commits on Sep 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6b22b38 - Browse repository at this point
Copy the full SHA 6b22b38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f20d44 - Browse repository at this point
Copy the full SHA 9f20d44View commit details
Commits on Sep 26, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 22a3b70 - Browse repository at this point
Copy the full SHA 22a3b70View commit details
Commits on Oct 29, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 2f7ddf7 - Browse repository at this point
Copy the full SHA 2f7ddf7View commit details
Commits on Mar 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for d37a00d - Browse repository at this point
Copy the full SHA d37a00dView commit details
Commits on Aug 29, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 7f06258 - Browse repository at this point
Copy the full SHA 7f06258View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.