Hitting Enter always run a specific Button script

Hi all,

I have a button on one of my form. I want to make the button as default selected. That mean, when ever a User hit on enter(on Windows and Mac), it will run the method associated on the onAction() event of that button.

Is this doable? Can anyone please assist me on the same?

Thanks,
Sasmit

sasmithota:
Hi all,

I have a button on one of my form. I want to make the button as default selected. That mean, when ever a User hit on enter(on Windows and Mac), it will run the method associated on the onAction() event of that button.

Is this doable? Can anyone please assist me on the same?

Thanks,
Sasmit

Is this in web or smart ? Maybe is enough to use the onAction on some fields to achieve this (like for a login form) ?

I am in Smart Client.

Yes, but some time user clicked at the form and try hitting the enter key. At this situation, it is not firing the Script.

sasmithota:
I am in Smart Client.

Yes, but some time user clicked at the form and try hitting the enter key. At this situation, it is not firing the Script.

Then you can try some keylistener plugin. In Servoy 5 we have a function createShortcut in plugin window. Also, there is at least one third party plugin.

lvostinar:
Also, there is at least one third party plugin.

I believe you are referring to this one: http://www.servoy-stuff.net/key_listeners.php

Yes, The thing I am really looking for.

Thanks Robert.

-Sasmit