rawKeyDown and key codes

Björnke von Gierke bvg at mac.com
Sun Sep 23 18:04:21 EDT 2007


As this is one of the cornerstones of many apps, it certainly should 
work. Note that nothing will happen in the field itself. Instead, a 
number should be appear in the message box. That will be the number you 
want.

For your convenience I made a step by step guide:

1. Make a new stack
2. Drag a field from the tools palette to your stack
3. Open the script of that field, and input the following lines:
     on rawKeyDown pKey
        put pKey
     end rawKeyDown
4. Change to the browse (or run) tool, by clicking the arrow in the 
tools palette
5. Click on the field with the script
6. Hit any key on your Keyboard (I guess you're interested in the comma)
7. In the message box, the number of the key appears (for comma: 44)

sorry if this seems overly pushy
Bjoernke

On 23 Sep 2007, at 23:52, Paul Gabel wrote:

> Hi Ken:
>
> Thanks for your suggestion, but unfortunately it doesn't work. When I 
> type anything in the field, nothing shows up. Any other thoughts?
>
> Paul Gabel
> ---------------
> On Sep 23, 2007, at 2:08 PM, Ken Ray wrote:
>
>> On Sun, 23 Sep 2007 13:15:21 -0700, Paul Gabel wrote:
>>
>>> Hello everybody:
>>>
>>> In the Docs under rawKeyDown I find this sample script ...
>>>
>>>   on rawKeyDown theKeyNumber
>>>     if theKeyNumber is 65308 then increaseScroll -- mouse wheel down
>>>     else if theKeyNumber is 65309 then decreaseScroll -- mouse wheel 
>>> up
>>>     else pass rawKeyDown -- don't forget this!
>>>   end rawKeyDown
>>>
>>> ... but I can't figure out how to get theKeyNumber in the first
>>> place. I know it's just a rawKeyDown parameter here, but how would I,
>>> for example, determine "theKeyNumber" for a comma so that I can trap
>>> for it? Is there a list some place? Thanks.
>>
>> You can always create a dummy field with  the script:
>>
>> on rawKeyDown pKey
>>   put pKey
>> end rawKeyDown
>>
>> Then type the comma in the field and you'll get your result.

-- 

official ChatRev page:
http://chatrev.bjoernke.com

Chat with other RunRev developers:
go stack URL "http://homepage.mac.com/bvg/chatrev1.3.rev"




More information about the use-livecode mailing list