Page 2 of 3

Re: Missing keyUp

Posted: Tue Jun 21, 2022 10:08 pm
by dunbarx
Richmond.

Just a gadget to see when the message is trapped, and that every time it is the dialog presents something completely different.

Craig

Re: Missing keyUp

Posted: Wed Jun 22, 2022 5:36 pm
by RCozens
Craig,

Since I can't make it fail here I'm grasping at straws, but:

(1) Your keyUp handler in the card script includes the parameter, "x"; but the message sent by the button or from the Message Box does not pass that parameter.

(2) Since you are initiating the message from a handler instead of from the keyboard, why not give the handler in the card script a custom name instead of "keyUo"? Do you really want the card to respond every time a key is actually pressed?

Re: Missing keyUp

Posted: Wed Jun 22, 2022 5:45 pm
by jacque
I've seen LC lose the stack focus often. When that happens I can no longer execute a handler from the message box unless I use "send" as you did. This has been going on for years. When it gets too irritating I restart LC which usually fixes it. My guess is that's what happening to you too except it doesn't account for the other keypress messages that do get sent.

Maybe the focus is moving to the message box or the message watcher? What if you close all IDE palettes and tools?

Re: Missing keyUp

Posted: Wed Jun 22, 2022 7:24 pm
by dunbarx
Rob.

The parameter is optional, though always "there" as empty if nothing is written.

This was all derived from another thread, not mine, where the OP needed guidance:
https://forums.livecode.com/viewtopic.php?f=7&t=37044
There are lots of ways around the problem, but I was interested in what was actually causing the problem.

Craig

Re: Missing keyUp

Posted: Wed Jun 22, 2022 7:29 pm
by dunbarx
Jacque.

Regarding focus, Jean-Marc mentioned something similar. But I cannot send a keyUp message in a new session, opened via my tiny test stack right from the desktop, with only this in the card script:

Code: Select all

on keyUp x
   answer x
end keyUp
Hiding the tools palette does nothing; the only other window shown is the test stack itself. Focus seems to "stay" on that little stack, by virtue of watching its titlebar, which stays intact.

Oh, did I mention that trashing the prefs a few weeks ago fixed this for a while? Oh, oh, and did I mention that trying my test stack in v.8.1 worked fine until I tried it in v.8.6, and then it never worked again, including back in 8.1, and especially back where I am now, in 9.6.1.

Craig

Re: Missing keyUp

Posted: Thu Jun 23, 2022 2:32 pm
by stam
I'm afraid that i can't replicate this error either.

I created a new stack with 1 field

if i put

Code: Select all

on keyUp x
     answer x 
end keyUp
in the field script, it works when typing in the field.
If it put it in the card script, it works whether in the field or if no control has the focus...

sorry...
(LC 10 DP3, on MacOS)

Re: Missing keyUp

Posted: Thu Jun 23, 2022 5:02 pm
by RCozens
This was all derived from another thread, not mine, where the OP needed guidance:
https://forums.livecode.com/viewtopic.php?f=7&t=37044
Thanks for the URL to the original post: I was wondering why keyUp was triggering the action instead of keyDown.

Re: Missing keyUp

Posted: Thu Jun 23, 2022 5:11 pm
by stam
The mystery however remains as to why Craig can't get on keyUp to work, when it seems fine to others, myself included.

@Craig - what OS and LC version are you using? Have you tried launching LC without any plugins/extensions?

S.

Re: Missing keyUp

Posted: Thu Jun 23, 2022 5:49 pm
by jacque
Hiding the tools palette does nothing; the only other window shown is the test stack itself. Focus seems to "stay" on that little stack, by virtue of watching its titlebar, which stays intact.
Right, that's part of the bug. The stack appears to have focus, "the name of this stack" in the message box returns the right name, but commands from the message box tell you the stack can't be found unless you use "send" specifically. My guess is that one of the IDE scripts is interfering with the message path.

This has been going on for a long time but I haven't reported it because it isn't repeatable reliably and is fairly rare. Restarting LC fixes it.

Re: Missing keyUp

Posted: Thu Jun 23, 2022 6:15 pm
by dunbarx
Restarting LC fixes it.
HAHAHAHAHAHA,

Good one, Jacque.

Craig

Re: Missing keyUp

Posted: Thu Jun 23, 2022 6:18 pm
by dunbarx
Stam.
what OS and LC version are you using? Have you tried launching LC without any plugins/extensions?
OS 10.15.7
LC 9.6.1, 9.6.6, 8.1, 8.6

Have not tried 1.0.

And yes, without plug-ins.

But know that this missing message has shown its face in the middle of a session, where I certainly have not changed anything in the current set-up.

Craig

Re: Missing keyUp

Posted: Thu Jun 23, 2022 10:47 pm
by Silvius
It works also with the community Edition 9 5 0 Build 15503

Re: Missing keyUp

Posted: Thu Jun 23, 2022 11:10 pm
by Silvius
I have checked it just again, it works with alphanumeirckeys etc., but not with enter or or shift etc.

Re: Missing keyUp

Posted: Thu Jun 23, 2022 11:56 pm
by mwieder
Yep - that's documented:
If the key pressed is the Return, Tab, Backspace, Delete, or Enter key, an arrow key, or a function key, no keyUp message is sent.

Re: Missing keyUp

Posted: Fri Jun 24, 2022 12:41 am
by Silvius
Test Test Test