Page 1 of 1

keyUp no longer working

Posted: Tue May 24, 2022 8:14 pm
by dunbarx
This derives from another thread:
https://forums.livecode.com/viewtopic.php?f=7&t=37044

On an new stack, place this in the card script;

Code: Select all

on keyUp
   beep 2
end keyUp
Pressing any key, last night I would have gotten two beeps. Earlier today I would have gotten two beeps. Right now, in the same stack that I used to get two beeps, I get no beeps.

"keyUp" no longer works. New LC session, new stack, whatever, that message is no longer sent. The message watcher confirms it.

Was that message universally and retroactively deprecated? Is it just me? Why do I suspect the latter?

Craig

Re: keyUp no longer working

Posted: Tue May 24, 2022 8:38 pm
by richmond62
This works perfectly:

MacOS 12.5 beta
LC 9.6.3

Code: Select all

on keyUp 
   if the backGroundColor of this stack is red then
      set the backGroundColor of this stack to blue
   else
      set the backGroundColor of this stack to red
   end if
end keyUp
Which would suggest something about beep, and not keyUp.

Re: keyUp no longer working

Posted: Tue May 24, 2022 8:54 pm
by bn
Craig,

when the messagebox is visible then I see what you describe. The keyUp handler in the card does not trigger. Closing the message box restores the expected behavior: 2 beeps.

As to why: I noticed that when nothing on the card has focus and the message box is open the actual stack looses focus and the message box receives the keys. They show up in the message box.

Kind regards
Bernd

Re: keyUp no longer working

Posted: Tue May 24, 2022 10:18 pm
by dunbarx
Bernd.

I RACED to see if that was true. It is not, at least for me.

Made sure the Message Box was gone. Still no luck with "keyUp". I cannot get that message to fire at all.

Craig

Re: keyUp no longer working

Posted: Tue May 24, 2022 10:20 pm
by dunbarx
Richmond.
Which would suggest something about beep, and not keyUp.
The issue is simply using that message. A breakpoint set right at the "on keyUp" line never fires, regardless of the code in the handler, or if there is anything at all between the "on" and "end".

Craig

Re: keyUp no longer working

Posted: Tue May 24, 2022 10:31 pm
by dunbarx
OK.

Here is a stack that demonstrates the loss of the "keyUp" message. I assume I am the only one who will not get a random number if any key is pressed and released.
noKeyUp.livecode.zip
(1.06 KiB) Downloaded 141 times
Just checking...

Craig

Re: keyUp no longer working

Posted: Tue May 24, 2022 10:42 pm
by dunbarx
OK.

Fixed, and I should have realized to try this first, given the oddity of the problem. Trashed the prefs, and the issue went away.

Craig