Page 1 of 1

KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 8:13 pm
by dunbarx
On a card with a button and a wide field, put this in the button script:

Code: Select all

on mouseUp
 keysDownTest
end mouseUp

on keysDownTest
   if the commandKey is down then exit to top
   put the keysDown into fld 1
   send "keysDownTest" to me in 1 
end keysDownTest
Now press a few keys. You get a result in the field, and with certain key combinations I was able to see 9 items.

Cool.

Herman thought one could get a max of five. I did not know you could get more than one. But in my defense, I never used that function before.

Now press, in order, "ASDJKL". I get six items. But now press, in order, "ASDF". The "F" will not register.

If one plays around with different combinations of keys, whether or not control keys are included in the mix, there are some keys that do not play well at all. For example, the string "ZXC" stops after the "X", for a total of only two. (Actually the order of the keys does not matter, only the mix)

My question is, what is going on? It actually could matter if one needed certain combinations for some task.

Anyone ever see this? Anyone care?

Craig Newman

Re: KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 9:08 pm
by FourthWorld
I'm assuming you mean "press and hold", yes?

I get all keys here on Ubuntu, but not as letters, as numeric key code values; e.g. "ADSF" shows as "97,115,100,102".

Re: KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 9:18 pm
by dunbarx
Richard.

Yes, press and hold. The "keysDown" function is very literal; it says "down", It means "down". And yes, you get ASCII or "rawKey" information depending on the type of key.

So it is a Mac thing? Any Windows keyPress operators out there? If it is OS dependent I will file a bug report.

Craig

EDIT.

I am on Mac 10.13. LC 8.1.10

Re: KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 9:25 pm
by FourthWorld
Seems to work the same for me on Win10 as it does in Ubuntu.

Re: KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 9:34 pm
by [-hh]
Craig.
This may also depend on keyboard settings (repeat rate and delay) and, was here the reason some time ago, on the hardware: A newer keyboard had better results, especially with a, c, v, x, z and the optionKey.

Re: KeysDown misses certain keys?

Posted: Fri Oct 12, 2018 10:15 pm
by dunbarx
Hmmm.

I do have an old clunker of a keyboard. I will try another.

Craig

Re: KeysDown misses certain keys?

Posted: Sat Oct 13, 2018 3:26 am
by dunbarx
So sitting here with a MacBook Air, all those keys that did not work at my office on an old MacAlley keyboard now work fine.

I never would have thought of that.

Craig