How to get ‘RETURN’ button action in the keyboard

#1

I want to get ‘return’ button action from iOS or Android keyboard. Requirement is to hide the keyboard when the user taps on ‘return’ button.

Any idea how to trigger the action?