Trapping The Keypad 'Clear' Key

Richard Gaskin ambassador at
Thu Oct 30 03:47:36 EST 2003

Cubist at wrote:

> sez igor at
>> On 30/10/2003, at 2:59 AM, Ken Ray wrote:
>>> Trap the rawKeyDown or rawKeyUp message and look for 65407. I'm pretty
>>> sure it's the same on all platforms, but haven't tested it yet.
>> This is *precisely* what I'm concerned about, though: will this number
>> be the same on ALL keyboards, and ALL PLATFORMS? Is this number based
>> on some hardware standard that all manufacturers must adhere to, or
>> will there be variations?
> Personally, I'd be very surprised if it *were* the same on ALL keyboards
> and ALL platforms. I'd recommend that you decide which platforms you want to
> support, create however-many custom property sets you need to contain all the
> rawKey codes for the platforms you support, and select the appropriate custom
> property set in your stack's "on startUp" handler.

I'd be surprised if they weren't, if not for all OSes then at least for
most.  How would keyboard manufacturers be able to make standard keyboards
without a standard to follow?

In a quick test here on OS X and XP, the Clear, Home, Scroll Up, and Scroll
Down buttons all generate the same codes using this simple test script:

  on rawkeydown k
     put k
     pass rawkeydown
  end rawkeydown

My Linux box is off right now and I don't have much time today to test
further anyway, but if someone does I'd be very interested to hear if the
key codes are different.

As much as I'm fond of swapping custom property sets for all sorts of things
(I'm working on a stack right now that uses them to store US and UK
spellings for control labels), with key codes it'll hopefully prove to be

 Richard Gaskin 
 Fourth World Media Corporation
 Ambassador at
 Tel: 323-225-3717                       AIM: FourthWorldInc

More information about the Use-livecode mailing list