I want to trigger an action using Enter key in my onkeypress event
Hi sierra,
This thread should answer your question: https://www.outsystems.com/forums/discussion/67671/trigger-an-action-with-the-enter-key/
Hi Jeroen Barnhoorn,
I tried it and it works. However, it says that it is deprecated, would it be a problem in the future?
Would it be a problem? Probably not, at least not for the foreseeable future. However, it would indeed be better to use keydown and key instead:
document.addEventListener('keydown', function enterPress(e) { if(e.key == 'Enter') { $actions.ScreenAction(); }});
Thank you