Can a shortcut be run while textfield is focused in GUI?

Here’s my issue.
I want to be able to open a GUI - highlight a textfield, be able to type into it, and WHILE the textfield is active / in edit_mode, trigger a shortcut.

How would this be done, please?

I can already open a GUI so that the textfield is auto-selected and ready for typing, but i need to, while in the textfield, be able to trigger a shortcut.
currently, if i use enter/return to trigger a shortcut while the dialog is open, i need to press enter twice (once to blur, once to run).
how can i make a textfield only accept numbers and dots, and if anything else is pressed, do something else with them?

Custom shortcuts within custom text fields are currently not supported.