UIKeyCommand for the Enter key on Mac keyboard's numeric keypad?

I'm using the Xcode 11 beta and using Catalyst ("the checkbox") to run an iPad app on the Mac.

I've been able to use the following UIKeyCommands for input from the Mac keyboard:

//the delete button
UIKeyCommand(input: "\u{8}", modifierFlags: [], action: #selector(backspacePress)

//the "return" button
UIKeyCommand(input: "\r", modifierFlags: [], action: #selector(enterPress))

//the up arrow
UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(enterPress))

//letters or numbers
UIKeyCommand(input: "1", modifierFlags: [], action:  #selector(keyPressed(sender:)))

When I create the key command input for a number, it works both with the top row of numbers above QWERTY and also on the keyboard's numeric keypad on the right side of the keyboard.


Does anybody know where I can find the correct escape sequence like

\r
or
\u{8}
that I can use to detect a key press on the "enter" key of the numeric keypad (on the right side of this Apple keyboard)?


Thanks so much for any help!



(I did see that you can pass a modifier flag of .numericPad but I believe that is for iOS keyboards when in numeric mode)

Accepted Answer

Don't know if you found the answer but it's "\u{3}". I looked for this a long time. I found a free app on the Mac App Store called "Key Codes" and it showed the answer.

This seems to be the answer! Glad you got it figured out. Thanks for your reply!

UIKeyCommand for the Enter key on Mac keyboard's numeric keypad?
 
 
Q