Text field in Windows standalone not receiving keyboard focus
Curry Kenworthy
curry at pair.com
Fri Jan 29 20:42:49 EST 2021
Andrew:
> I can’t add a breakpoint because the Remote Debugger
> will take focus from the standalone
Behold the power of the log file:
Logs DOMINATE standalone debugging for all but the simplest issues.
They don't affect focus, either.
(Remote Debugger is cool, but like most things, has big limitations.)
> If I add an answer “foo” the focus is properly shifted
> to the field after the modal.
Yes, I've seen that happen! And getting focus back by switching the app.
Familiar, but can't recall the culprit. Also, might have been on Mac:
one Mac project with a window shape and floating window acted up.
The more complexity a stack has, the more things can interact.
I do remember this: it didn't take long to fix or work around!
That's why it was a fleeting memory. So take heart.
If pasting can work around it, so can your code. Take charge of focus.
Or even better, finish debugging and fix the underlying cause.
> The card also doesn’t receive this message until the focus issue
> is resolved as described before
So someone else is receiving those keystrokes. Who?
Could be a script. A stack. A control that doesn't pass the message.
(And for each of those - could be yours, or LiveCode's/third party.)
Use your log, record where the focus is, pin down the perp.
Record the relevant field properties too, just in case.
>> - any front script or other library intercepting keystrokes?
> Nope
Is that proven, or just AFAYK?
But I wouldn't be surprised if it's a stack or other group/control.
> Datagrid, but not on this field or parent group.
DG is beautiful, but so often introduces issues.
Of course I wouldn't rip it out at this late point.
It might not be the culprit. Even if it is, you can work around.
Good news: pretty easy to fix or work around this!
I've had a very similar issue....
Best wishes,
Curry Kenworthy
Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.com/
More information about the use-livecode
mailing list