ENTER key chr value

Some keyboards (iMac) have two enter keys. But I always thought they have the same CHR value, which is not the case so it seams.
One is 13 , what is the other?

BTW I do not have such keyboard so I cannot test it myself.

1 Like

On Windows the enter key on the numeric keyboard presents as CHRB(03). Probably the same on Mac.

Thanks Wayne, will try that asap.

You an press function + return to get enter.

Traditionally on Macs (since at least Mac OS 9), the “Enter” key has always been chr(13) and the “Return” key chr(3).
I’d be surprised to see one keyboard on Mac whose both keys produce the same ascii value (while, on Linux and Windows, it’s always been undistinguishable; hard to use both keys differently inside an app).

That’s backwards. Return is ASCII 13, Enter is ASCII 03. Just put a breakpoint in the KeyDown event and see the (binary) value of key yourself.

You’re right, but I wasn’t confused about the numbers, only the names. Chr(3) is the one in the numeric pad and Car(13) below backspace; I just swapped the names when I wrote my reply.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.