Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show partial shortcut while editing. (#6050)
And automatically accept/validate shortcuts when valid. - When receiving a modifier only event, use the event Modifiers to show the current partial shortcuts. - we need to handle keyrelease events otherwise the following sequence is incorrect. ``` Action – Shortcut shown --------------------------------- Press Ctrl – Ctrl Also Press Alt – Ctrl-Alt Release Ctrl – Ctrl-Alt ``` Though now that we handle release, the user cant press a shortcut and then validate with enter as as soon as the user release the shortcut the QLineEdit will become empty. But we don't care as we only want full shortcuts and not modifiers only. Thus validate as soon a shortcut is valid, and contain a non-modifier key. There is also this whole Meta/Alt/Ctrl are not the same on MacOS. I did not extract the logic into naprai/utils/interactions as those are Qt Specific, moreover the values of QtEvent.Modifiers are not the same than Qt.Keys. You will note that there is one weirdness in the order of modifiers when typing these, but I believe this will be fixed upstream. This is due to the fact that when pressing `Ctrl` then `Shift` for example, `Shift` is the `Key` event, and this will appear at the end. While when doing `Shift`, then `Ctrl`, ctrl is the key that will appear at the end. Closes #6047 ## Type of change - [X] New feature (non-breaking change which adds functionality) # How has this been tested? This needs to be tested on more platforms. --------- Co-authored-by: Kira Evans <contact@kne42.me>
- Loading branch information