Page 1 of 1

F4 on an input area ..

Posted: Thu May 09, 2019 8:37 am
by svi
Hello,
I want to know the best solution to manage in Visual Designer an F4 on an input area ...
Thank you in advance.

Re: F4 on an input area ..

Posted: Thu May 09, 2019 9:42 am
by Scott Klement
You can define F4 under the 'shortcut key' property of a button. Then, pressing F4 on the keyboard will have the same effect as clicking the button.

Re: F4 on an input area ..

Posted: Fri May 10, 2019 5:14 am
by svi
In fact it's not on a button but on an input area that I have to do the f4

I try to put a button to simulate the f4 on my area via
Edit Onclick Event:
changeElementValue(XWFLDN,'FMCUNO');
pressKey("F4");
)..

but it works moderately it's ok if I click on it directly but if I click on another area of my screen and then I click on it then the f4 does it but not on the right zone

in debug I realize that after my click my zone XWFLDN does not contain 'FMCUNO' but the name of another zone screen ....

I hope I am clear in my explanations!!

Re: F4 on an input area ..

Posted: Tue May 14, 2019 12:16 am
by Scott Klement
Ah, I see... so you don't want it to work like a green-screen (where the F4 applies to the entire screen) but instead you want to write separate code for each widget's F4 key?

To do that, write JavaScript code that runs in the widget's "onkeydown" (when the key is pushed down) or "onkeyup" (when it is released).

For example, in the onkeydown event of a textbox, code the following:

Code: Select all

function myFunc(event) {
  if (event.keyCode===115 && !event.shiftKey) {
    alert("F4 pressed");
    preventEvent(event);
  }
}
myFunc
When the user presses F4 in that textbox, it will pop up an alert saying "F4 pressed". Replace that "alert" code with whatever code you wish to perform when the F4 key is pressed. This will only run in the widget you define it under (and will not affect other widgets.)

Re: F4 on an input area ..

Posted: Tue May 14, 2019 4:04 am
by svi
thank you !!