Fix ModKeys mapping allowing for keyboard shortcuts #79
+24
−6
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.
Issue
Current commented out implementation maps 2 keys to the same modifier key and call it separately.
Input state will flip flop between pressed and released when only 1 modifier key is pressed, resulting in UI slowdown due to repeated input event handling.
Fix
Use a single
io.AddKeyEvent()call to activate modifier key when either modifier key is pressed.Also passthrough the individual modifier keys itself so input handling can be done on the imgui layer for those specific keys.
Additionally map the OSX command key to super.
Resolves #78 and #75
Workaround
If you are here due to copy paste or any modifier key shortcut not working and the fix is not merged, place the following code into any
Update()function.