-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix to allow CTRL+A key combination to work with multiple EditBox instances #2246
Conversation
I'm just worried that this could stop sending key events coming to the app through GLFW. For example, we hook GLFW to get events to the ImGui. So if you have an EditBox in scene, could this stop key events getting to the GLFW and ImGui? |
I just tested it with ImGui, and it does stop the @halx99 I'll close this PR, and perhaps in the future we can find a better solution to this. It's not really a problem that users can't use |
If developers do really need this, then perhaps we can make the behaviour in this PR optional, defaulting to disabled. The developer would need to explicitly enable it, knowing the side-effects of the If that is acceptable, then I can re-open this PR and add the necessary changes to toggle the functionality on or off at runtime. |
Would it be possible to subscribe for Edit: also, maybe it's a good idea to select all text automatically when edit box is activated? |
Possibly, by calling the I'm looking into the possibility of just checking for a specific character with modifier on input prior to setting the text, and if
That's a good idea, and it should be something the developer can toggle. It should default to disabled to keep the same functionality. Can add it in a separate PR. |
@smilediver Much simpler solution in PR #2251 that doesn't block hotkeys to ImGui etc.. |
Describe your changes
PR #2238 only worked with the first instance of an
EditBox
, because it seems that the same hotkey combination cannot be registered more than once globally, regardless of the unique address of theEditBox
that it is bound to.The changes in this PR register the
CTRL+A
key combination against the app Win32 window, and specifically checks if anEditBox
is currently focused before applying the select-all text action. It also automatically de-registers theCTRL+A
hotkey if all instances of EditBox are freed.I'm not certain if this is the best solution to the issue, so if anyone sees any potential issues with this implementation, please leave feedback.
Issue ticket number and link
#2236
Checklist before requesting a review
For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."
I have performed a self-review of my code.
Optional:
For core/new feature PR