KeysDown misses certain keys?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

KeysDown misses certain keys?

Post by dunbarx » Fri Oct 12, 2018 8:13 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: KeysDown misses certain keys?

Post by FourthWorld » Fri Oct 12, 2018 9:08 pm

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".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: KeysDown misses certain keys?

Post by dunbarx » Fri Oct 12, 2018 9:18 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: KeysDown misses certain keys?

Post by FourthWorld » Fri Oct 12, 2018 9:25 pm

Seems to work the same for me on Win10 as it does in Ubuntu.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: KeysDown misses certain keys?

Post by [-hh] » Fri Oct 12, 2018 9:34 pm

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.
shiftLock happens

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

Re: KeysDown misses certain keys?

Post by dunbarx » Fri Oct 12, 2018 10:15 pm

Hmmm.

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

Craig

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

Re: KeysDown misses certain keys?

Post by dunbarx » Sat Oct 13, 2018 3:26 am

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

Post Reply

Return to “Talking LiveCode”