I have created a form with multiple PowerShell scripts available to the user (primarily searches for AD objects). Each of these has the option to run and display on screen or export to file via buttons.
I would like to improve this by allowing users the option to hit a key (enter for example) to run the script. Is there a way I can do this? I know it is possible to use this option if there is a single button, but I can't work out how to do this for multiple options.
Is there a way to do this
Use keypress to trigger script
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Use keypress to trigger script
There can only be one default action per form. The enter key is assigned to the defined default.
You can handle all keys and detect the enter key and have it do anything you want but it has to be hand coded.
You can handle all keys and detect the enter key and have it do anything you want but it has to be hand coded.
Re: Use keypress to trigger script
Thanks, kind of figured that was the case but wanted confirmation. I'll leave it so the users have to use the mouse to hit the button they want to use.jvierra wrote:There can only be one default action per form. The enter key is assigned to the defined default.
You can handle all keys and detect the enter key and have it do anything you want but it has to be hand coded.