Is there a way to Prevent Default for only certain keys

I want to make it where if I press enter in a text box in a form it will exit it, but upon making a onKeyPress event I have realized that I don't think there is a way to prevent default for specific keys that are pressed?

Wondered if anyone knew a way before I resorted to "exploiting" with a JS injection

Not sure I understand what you mean by "prevent default".

Is the desire to have an onKeyPress event that only looks for the Enter key?

Just note that IA will be removing this ability with the Markdown component in a future version