Missing keyUp

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 10:08 pm

Richmond.

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

Craig

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Missing keyUp

Post by RCozens » Wed Jun 22, 2022 5:36 pm

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?
Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Missing keyUp

Post by jacque » Wed Jun 22, 2022 5:45 pm

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?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Missing keyUp

Post by dunbarx » Wed Jun 22, 2022 7:24 pm

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

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

Re: Missing keyUp

Post by dunbarx » Wed Jun 22, 2022 7:29 pm

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

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Missing keyUp

Post by stam » Thu Jun 23, 2022 2:32 pm

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)

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Missing keyUp

Post by RCozens » Thu Jun 23, 2022 5:02 pm

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.
Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Missing keyUp

Post by stam » Thu Jun 23, 2022 5:11 pm

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.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Missing keyUp

Post by jacque » Thu Jun 23, 2022 5:49 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Missing keyUp

Post by dunbarx » Thu Jun 23, 2022 6:15 pm

Restarting LC fixes it.
HAHAHAHAHAHA,

Good one, Jacque.

Craig

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

Re: Missing keyUp

Post by dunbarx » Thu Jun 23, 2022 6:18 pm

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

Silvius
Posts: 7
Joined: Tue Jun 14, 2022 7:59 pm
Location: Bochum, Germany

Re: Missing keyUp

Post by Silvius » Thu Jun 23, 2022 10:47 pm

It works also with the community Edition 9 5 0 Build 15503

Silvius
Posts: 7
Joined: Tue Jun 14, 2022 7:59 pm
Location: Bochum, Germany

Re: Missing keyUp

Post by Silvius » Thu Jun 23, 2022 11:10 pm

I have checked it just again, it works with alphanumeirckeys etc., but not with enter or or shift etc.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Missing keyUp

Post by mwieder » Thu Jun 23, 2022 11:56 pm

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.

Silvius
Posts: 7
Joined: Tue Jun 14, 2022 7:59 pm
Location: Bochum, Germany

Re: Missing keyUp

Post by Silvius » Fri Jun 24, 2022 12:41 am

Test Test Test

Post Reply

Return to “Talking LiveCode”