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: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 4:42 pm

The "keyUp"message has disappeared.

This happened to me once before, several weeks ago, and trashing the prefs file fixed it. But now even that does not cut it.

So a new stack in a new session has this in its card script:

Code: Select all

on keyUp x
   answer x
end keyUp
Nothing. The message does not appear in the message watcher, though all its siblings, "keyDown", "rawkeyWhatever" do.

At the risk of repeating myself, "just me?" Shall I delete it from the dictionary?

Craig

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Missing keyUp

Post by jmburnod » Tue Jun 21, 2022 4:51 pm

Hi Craig,
It works here (LC 9.6.6)
Kind regards
Jean-Marc
https://alternatic.ch

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

Re: Missing keyUp

Post by RCozens » Tue Jun 21, 2022 5:01 pm

Morning Craig,

keyUp works for me here: V9.6.2/Win32

I tried placing your handler in the stack script, the card script, & a field script. It worked in all three.

Cheers!
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.

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 5:22 pm

Thanks, guys.

But I expected no less. It is me. I now have to go around and find all the "keyUp" handlers I ever wrote everywhere, and see if they are now broken.

Craig

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 5:44 pm

Just trashed the prefs file, which worked last time. Nope
Just tried with another version of LC (9.6.6). Nope
Just restarted. Nope.

I have never seen anything quite like this, the complete loss of a message.

I went back to v8.1 and tried the same handler in the card script. Worked! Then tried 8.6. Did not work. Went BACK to 8.1. No longer worked.

Something in my setup is doing this. I am not sure it is LC per se, though I cannot imagine what that could mean.

Craig

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

Re: Missing keyUp

Post by richmond62 » Tue Jun 21, 2022 6:51 pm

I hope it isn't simply a matter of a worn-out keyboard?

At the risk of thee and me looking like a pair of prunes, it would be a moment's work to check by jacking in another keyboard and pressing a few keys.

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 6:54 pm

Richmond.

The keyboard don't enter into it.

Pressing any key invokes, "keyDown", rawKeyDown" and "rawKeyUp", as always, as expected.

Just not "keyUp". Ever. LC just ain't getting it.

Craig

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 7:06 pm

Richmond.

But you made me think. No mean feat.

Again, in the card script:

Code: Select all

on keyUp x
   answer x && random(99)
end keyUp
This works from msg:

Code: Select all

send "keyUp" && "x" to this cd
I can set a breakpoint and trap the message, or not. I get something like "x56".

But pressing a key does nothing. And I tried another keyboard anyway, but as expected, that is not the issue.

Craig

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

Re: Missing keyUp

Post by richmond62 » Tue Jun 21, 2022 7:32 pm

Let's get that stuff about stealing focus out the way
with one thing aimed at the msgBox and another at
a field:

Code: Select all

on keyUp KU
put KU
end keyUp
and

Code: Select all

on keyUp KU
put KU into fld "fOUTPUT"
end keyUp
see what gives.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Missing keyUp

Post by SparkOut » Tue Jun 21, 2022 8:23 pm

There's definitely no keyUp handler in a frontscript?

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 8:26 pm

Sparkout.

Good thinking, but no. I use backScripts, but have never included a frontScript in anything I have ever done.

In any case, this message failure has simply appeared out of the blue, on more than one occasion, and in the middle of a single session. Again, I fixed it once by trashing the prefs file, though that no longer seems to work.

I don't think anyone is going to be able to help. I am so desperate to know I even posted on the use-list. I will see what transpires on another machine tonight.

Craig

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

Re: Missing keyUp

Post by dunbarx » Tue Jun 21, 2022 8:35 pm

Richmond.

Maybe I am not understanding your point.

The message is sent however I send "keyUp" to the card. I just cannot do so by simply pressing a key from the keyBoard. Of course, that is its primary function. The others are just dodges, and do little good.

Craig

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 » Tue Jun 21, 2022 8:43 pm

Craig-

Do you have a control in focus when you press the key? According to the dictionary
The message is sent to the active (focused) control, or to the current card if no control is focused.
If the key pressed is the Return, Backspace, Delete, or Enter key, an arrow key, or a function key, no keyUp message is sent.

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

Re: Missing keyUp

Post by richmond62 » Tue Jun 21, 2022 8:48 pm

What is the point of your "x56" exactly?
-
SShot 2022-06-21 at 22.47.24.png

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

Re: Missing keyUp

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

Mark.

Jean-Marc had commented about focussed controls.

My new stack in a new session has none of that. Only an empty card, no msg box, and a card handler:

Code: Select all

on keyUp x
   answer x && random(99)
end keyUp
Just about as minimal as one can get. Press any key, nothing happens.

Now open the message box or make a button on the card. Use either to:

Code: Select all

send "keyUp" to this cd
Both send the message, the message is trapped and executed, and you get something like "x48"

Craig
Last edited by dunbarx on Wed Jun 22, 2022 7:44 pm, edited 1 time in total.

Post Reply

Return to “Talking LiveCode”