rawKeyUp pKeyCode &rawKeypDown pKeyCode

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
dntknwjck
Posts: 24
Joined: Sat Mar 23, 2019 6:14 pm

rawKeyUp pKeyCode &rawKeypDown pKeyCode

Post by dntknwjck » Sat Feb 22, 2020 7:53 pm

Hi
Just wondering if there is a list somewhere of the value for pKeyCode values returned in the rawKey handlers.

Thanks

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: rawKeyUp pKeyCode &rawKeypDown pKeyCode

Post by bogs » Sat Feb 22, 2020 8:06 pm

Well, you could always do something like -
https://sites.google.com/a/pgcps.org/livecode/keyboards wrote:B. Seeing what the handlers return for each key on the keyboard

To see the number for a key, add this code to the card script:

on updateScreen

put keysdown( ) into msg

send updateScreen to me in 20 millisec

end updateScreen

then add a button on the card:

on mouseUp
updateScreen
end mouseUp

As you press every key on the keyboard, this will show the return value of each key as you press it, in the msgbox (This is one of the icons on the Edit Bar of LiveCode).

Take out that line of code when you have noted the numbers of all the keys that you need to handle.
Image

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

Re: rawKeyUp pKeyCode &rawKeypDown pKeyCode

Post by FourthWorld » Sat Feb 22, 2020 10:18 pm

dntknwjck wrote:
Sat Feb 22, 2020 7:53 pm
Just wondering if there is a list somewhere of the value for pKeyCode values returned in the rawKey handlers.
Too vast, containing all keys and some special combinations, some of them differing by platform. You wouldn't want to read it.

Better to focus on solving the problem at hand: what would you like to do?

See Bogs' example above if you want to respond to a specific set of keys.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: rawKeyUp pKeyCode &rawKeypDown pKeyCode

Post by bogs » Sat Feb 22, 2020 10:35 pm

FourthWorld wrote:
Sat Feb 22, 2020 10:18 pm
See Cyril Pruszko's example above if you want to respond to a specific set of keys.
There, fixed that for you :D
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”