Page 1 of 3
Missing keyUp
Posted: Tue Jun 21, 2022 4:42 pm
by dunbarx
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:
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 4:51 pm
by jmburnod
Hi Craig,
It works here (LC 9.6.6)
Kind regards
Jean-Marc
Re: Missing keyUp
Posted: Tue Jun 21, 2022 5:01 pm
by RCozens
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!
Re: Missing keyUp
Posted: Tue Jun 21, 2022 5:22 pm
by dunbarx
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 5:44 pm
by dunbarx
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 6:51 pm
by richmond62
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.
Re: Missing keyUp
Posted: Tue Jun 21, 2022 6:54 pm
by dunbarx
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 7:06 pm
by dunbarx
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:
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 7:32 pm
by richmond62
Let's get that stuff about stealing focus out the way
with one thing aimed at the msgBox and another at
a field:
and
Code: Select all
on keyUp KU
put KU into fld "fOUTPUT"
end keyUp
see what gives.
Re: Missing keyUp
Posted: Tue Jun 21, 2022 8:23 pm
by SparkOut
There's definitely no keyUp handler in a frontscript?
Re: Missing keyUp
Posted: Tue Jun 21, 2022 8:26 pm
by dunbarx
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 8:35 pm
by dunbarx
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
Re: Missing keyUp
Posted: Tue Jun 21, 2022 8:43 pm
by mwieder
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.
Re: Missing keyUp
Posted: Tue Jun 21, 2022 8:48 pm
by richmond62
What is the point of your "x56" exactly?
-
Re: Missing keyUp
Posted: Tue Jun 21, 2022 10:07 pm
by dunbarx
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:
Both send the message, the message is trapped and executed, and you get something like "x48"
Craig