ASCII codes and the number keypad
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
ASCII codes and the number keypad
I have a Mac laptop with an external (Apple) keyboard and want to use rawkeydown so that a minus sign will initiate an action in a specific field. The ASCII code is 45 in the main part of the keyboard, which works but it doesn't on the number pad. The latter is critical in this instance. Anyone know how to get this to work?
Re: ASCII codes and the number keypad
dsquance,
What exactly "doesn't" on the numerical pad?
Do you have a numlock key?
I have a setup exactly equal to yours (but the keyboard might be a different model). The - key gives - in the keyDown handler and 65453 in t he rawKeyDown handler.
Kind regards,
Mark
What exactly "doesn't" on the numerical pad?
Do you have a numlock key?
I have a setup exactly equal to yours (but the keyboard might be a different model). The - key gives - in the keyDown handler and 65453 in t he rawKeyDown handler.
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: ASCII codes and the number keypad
Using
as a field script, it gives me "45" for both keys.
while using
gives me "45" for the left "minus" key and "65453" for the "minus" key on the num pad.
The numlock key seems to have no effect.
I'm not sure it could be useful for you, anyway...
Kind regards,
Mario
Code: Select all
on keyDown theKey
put chartonum(theKey) into me
end keyDown
while using
Code: Select all
on rawKeyDown theKey
put theKey into me
end rawKeyDown
The numlock key seems to have no effect.
I'm not sure it could be useful for you, anyway...
Kind regards,
Mario
Re: ASCII codes and the number keypad
The number 64543 is what I needed, and works. Thanks to both of you who replied. I didn't remember there was a way to reverse my steps to get the number generated. There's nothing under ASCII in the help that mentions this.
Dave
Dave
Re: ASCII codes and the number keypad
Further to this, I'm trying to use this with an enterinfield handler, so that when a number is typed and then the minus sign is pressed, the negative of the number typed will be entered. Any suggestions?
Dave
Dave
Re: ASCII codes and the number keypad
I should have tried a few things before the last posting. I have a working solution. Thanks for this great resource.
Dave
Dave