unstable rawkeyDown

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: 10344
Joined: Wed May 06, 2009 2:28 pm

Re: unstable rawkeyDown

Post by dunbarx » Tue Dec 24, 2019 2:49 pm

Richard.

This may not be the first time I have missed something from LC 101. :wink:

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10055
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: unstable rawkeyDown

Post by FourthWorld » Tue Dec 24, 2019 5:03 pm

Since you're only checking one key why not use the supplied param?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: unstable rawkeyDown

Post by mwieder » Tue Dec 24, 2019 6:23 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10344
Joined: Wed May 06, 2009 2:28 pm

Re: unstable rawkeyDown

Post by dunbarx » Tue Dec 24, 2019 6:24 pm

Richard.

Don't distract me with straightforward solutions when all I want to do is cause alarm.

Craig

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

Re: unstable rawkeyDown

Post by mwieder » Tue Dec 24, 2019 6:27 pm

SpockEngineLight.jpeg
SpockEngineLight.jpeg (9.8 KiB) Viewed 3806 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10344
Joined: Wed May 06, 2009 2:28 pm

Re: unstable rawkeyDown

Post by dunbarx » Tue Dec 24, 2019 6:27 pm

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

Post Reply