Page 2 of 2
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 2:49 pm
by dunbarx
Richard.
This may not be the first time I have missed something from LC 101.
But the commandkeyDown handler I tried, as a few posts above, gives different results just as the rawKeyDown handler does:
Code: Select all
on commandKeyDown
put ""
put the keysDown
end commandKeyDown
Press the commandKey, and then press "f", in the normal way. Do so again, and again. I get, randomly,
"102,65511" and "65511". So I cannot rely on that either.
Craig
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 5:03 pm
by FourthWorld
Since you're only checking one key why not use the supplied param?
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 6:23 pm
by mwieder
Even with commandKeyDown you're still going to have to deal with the fact that the keyboard is continuing to generate keydown events and the IDE is catching those events.
Without actually going through the motions of checking I'd guess that an IDE library is catching the events once the stack script bails after trying to instantiate a modal dialog on top of an existing modal dialog. It's probably a bad idea to try to use keyboard equivalents that are already in use by both the IDE and the operating system. You could possibly monkeypatch the revMenuBar stack's command-F menuPick handler to avoid the situation.
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 6:24 pm
by dunbarx
Richard.
Don't distract me with straightforward solutions when all I want to do is cause alarm.
Craig
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 6:27 pm
by mwieder

- SpockEngineLight.jpeg (9.8 KiB) Viewed 4416 times
Re: unstable rawkeyDown
Posted: Tue Dec 24, 2019 6:27 pm
by dunbarx
Mark.
Richard made me do it.
Code: Select all
on commandkeyDown tkey
if tKey = "F" then ask "Find"
end commandkeyDown
Never seems to digress. The rest of this is academic, I suppose, since nobody has run across the anomaly in practice.
Thanks for the discussion, all.
Craig