Allow ALT and ALT + CONTROL (or ALTGR on Windows) accelerators. #922
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.
This pull request improves the Predicate 'controlKeysFilter' (previously named 'noControlKeys') allowing ALT and ALT + CONTROL (or ALTGR on Windows) accelerators.
When on Windows, if an ALT + CONTROL key combination prints a special character the event pass and is consumed. Else, the event is filtered and the accelerator can be invoked.
This is how the default TextArea and several IDEs such as JetBrains IDEs or Eclipse behave.
A test called AcceleratorsTests can be found inside the integrationTest module. This class tests
all possible situation, both on Windows and Unix / iOS. This test was executed on Windows (Latest and LTSC) and Ubuntu 19.04. A small project was also made to test the changes.
Note that some Windows versions invokes two KeyEvents. The first one contains a null character and the second one the special character. This is a Windows bug that makes an accelerator to be called even if the combination prints a special code. I've tested on two different Windows 10 versions (Latest and LTSC) and on the second one this happens. Luckily, this is a small bug that is only appreciable when there's an accelerator binded to a key combination that prints a special character.