Hmm, it looks there's an older post about this here - with a good example.
https://forum.omz-software.com/topic/2049/possible-to-subclass-uiview-and-redefine-keycommands-property/7
#UPDATE
The code linked works after minor changes (print, Python3)
While the example catches keys with a modifier, setting the modifier to 0
makes it possible to catch normal keys and it's possible to catch the
Enter key via chr(13).
So while this looks do-able, the question is if this is a good approach:
One problem with it is that I haven't found out how to trigger updates on
the main view from the function that collects the keys. In my example,
I'm trying to update a label on the view (form) with the number that is scanned.
I've looked at the ui examples, where there's a "sender.superview" that
allows to connect to the other elements of the view.
Here the keyboard control is added as a Subview to the main view, so that doesn't work.