A while ago I needed a Dynamic Action that was triggered by the user pressing a particular key.
It turns out Michel van Zoest wrote a nice article about that a couple of years ago, to be found on the Whitehorses site:
http://blog.whitehorses.nl/2014/01/28/catching-key-strokes-using-dynamic-actions-in-oracle-apex-4-x/.
See it in action by clicking in the Text Field below and pressing the Spacebar.