Question on KeysDown ()

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
penopia
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 25
Joined: Fri Apr 25, 2008 2:46 pm

Question on KeysDown ()

Post by penopia » Mon Feb 03, 2014 11:27 am

The Livecode Dictionary says "The keysDown function returns empty if no keys are being pressed." But keysDown() function always returns "255" even I don't press any key. Anyone can explain this to me ? Thanks

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Question on KeysDown ()

Post by Mark » Mon Feb 03, 2014 1:00 pm

Hi,

Which version of LiveCode do you use? Check your keyboard. Do you have any devices connected to USB, bluetooth or serial port for instance, which might cause this?

If I execute the syntax

Code: Select all

put the keysDown
in the message box, I get 65293, which is as expected, because that's the number of the return key.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Re: Question on KeysDown ()

Post by dunbarx » Mon Feb 03, 2014 4:36 pm

Hi.

Try this in a button:

Code: Select all

on mouseUp
   put random(99)
   wait 25
   put keysDown()
end mouseUp
You should always get a number, and then empty.

Craig Newman

penopia
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 25
Joined: Fri Apr 25, 2008 2:46 pm

Re: Question on KeysDown ()

Post by penopia » Wed Feb 05, 2014 5:02 am

Thanks.. Markm Craig

I can't duplicated the problem in this computer, itls going well.
I'm going to check again my home computer again.
I checked all the number returned form keysDown function.
Where the number "255" comes from ?? ....

Thanks again.

Post Reply