I use a Bluetooth Microsoft Number Pad with my Mac. I have a container control with Text Fields, combine boxes, an OK button and the default Cancel button.
Whenever I try to type a number with the Microsoft Number Pad, the Cancel Button button is triggered.
I can work around it by turning off the Cancel option in the editor, but then keyboard shortcuts for cancel don’t work.
I was able to figure it out with Karabiner Elements - an app for remapping keys. When you use the number pad it sends two key presses - on for “keypad_num_lock” and one for the key pressed.
In Karabiner Elements I remapped the “keypad_num_lock” to "vk_none (disable this key) and it stopped triggering the Cancel Button while still sending the key pressed.
I remember, in Mac OS 9 and early OS X (IIRC), the num lock key was reliably useable to cancel things, doing the same as the Esc key.
I’m not surprised this relation still exists today, though I can’t explain it clearly (and why it’s not always behaving like that is also vague).