keyUp no longer working

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

keyUp no longer working

Post by dunbarx » Tue May 24, 2022 8:14 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: keyUp no longer working

Post by richmond62 » Tue May 24, 2022 8:38 pm

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.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: keyUp no longer working

Post by bn » Tue May 24, 2022 8:54 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: keyUp no longer working

Post by dunbarx » Tue May 24, 2022 10:18 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: keyUp no longer working

Post by dunbarx » Tue May 24, 2022 10:20 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: keyUp no longer working

Post by dunbarx » Tue May 24, 2022 10:31 pm

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 74 times
Just checking...

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: keyUp no longer working

Post by dunbarx » Tue May 24, 2022 10:42 pm

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

Post Reply

Return to “Talking LiveCode”