# Vision Client Keystroke Scripts and F2

**URL:** <https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 12, 2026, 3:28pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930 "2026-02-12T15:28:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [February 12, 2026, 3:28pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930/1 "2026-02-12T15:28:23Z")

</div>

So I am updating an old factory link scada system to ignition, and they heavily used the function keys for nav and control. Everything works great, but the script tied to the F2 key. It will work fine, and then stop working all together.

I believe it to be a focus issue, where a component on screen is taking focus and eating the F2 command, instead of passing it to the client. When the client is in the state where it won’t fire the script, if I click inside an input component, the script will run(because I believe this component knows to pass the action to the client).

I have gone through the project and disabled focusable from all the objects in the header and footer, but it still happens sometimes.

Any ideas on how to get this script to run reliably off of F2 keystroke binding?

---

<div class="post-metadata">

**Author:** ![JantjeBeton](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JantjeBeton](https://forum.inductiveautomation.com/u/JantjeBeton)\
**Post date:** [March 11, 2026, 2:23pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930/2 "2026-03-11T14:23:37Z")

</div>

Sorry to say; No solution because I have similar problems.

We have to rebuilt an old application where navigation can (also) be done by using CTRL+ F1 - 12 and certain functions are triggerd by F2 - F12.  
This works fine, as long as no other windows are clicked. When you do, certain CTRL+F keys stop working. (CTRL F5 - F8)  
I've got a support request open, but no real answers there. Only to create an unsupported script and attach it to every window to override keystrokes. I.m.h.o. sounds like a work-around.  
Post: [https://forum.inductiveautomation.com/t/client-keystroke-script/22289/5](https://forum.inductiveautomation.com/t/client-keystroke-script/22289/5)

I've created a super simple project with just one screen and a button on that screen and keystroke-scripts for CTRL + F1 - F12 and F1 for good meassure.

Keystroke script for CTRL F1 - F12 and F1

```python
def onKeystroke():
	print("keystroke Key: %s, ctrl:%s, alt: %s, shift:%s, action: %s." %('F1', True, False, False, 'Pressed'))

```

Script on Event Handler of Button in the action-section under actionPerformed

`print("Action performed on button: %s, on window: %s." %(event.source.name, system.gui.getParentWindow(event).name))`

When the application launches, all CTRL-F keys and F1 are functioning (see log script in the client diagnostics below) When I press the button and the main screen that print statement is executed and visible in the diagnostics as well.  
After that, CTRL +F4 and CTRL + F6 are no longer printing their statements. Instead CTRL + F4 seams to close the opened window.... ??

From the client diagnostics (from startup):

> **Client diagnostics**
>
> 15:21:41.419 [Thread-0] INFO com.inductiveautomation.ignition.client.gateway\_interface.GatewayConnectionManager -- Updated login state. Logged in? true, Username: croon, Roles: [Administrator], Security Zones:   
> 15:21:41.421 [Thread-0] INFO com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook -- Auto-login successful  
> 15:21:41.481 [ProjectDownloader] INFO Vision.DownloadProjectPane -- Downloading "[http://localhost:8088/data/vision/client/project/plainFunctionKeys](http://localhost:8088/data/vision/client/project/plainFunctionKeys)"...  
> 15:21:41.501 [ProjectDownloader] INFO Vision.DownloadProjectPane -- Connect successful.  
> 15:21:41.502 [ProjectDownloader] INFO Vision.DownloadProjectPane -- Starting download of 7.072 bytes  
> 15:21:41.504 [ProjectDownloader] INFO Vision.DownloadProjectPane -- Download successful  
> Writing project to cache file C:\Users\croon.ignition\cache\gwlocalhost\_8088\C0\CplainFunctionKeys.proj  
> 15:21:42.592 [WebSocket@798491452-39] INFO com.inductiveautomation.ignition.client.gateway\_interface.GatewayConnectionManager -- WebSocket session is connected  
> 15:21:42.635 [connection-worker-1] INFO tags.subscriptions -- Changing connected quality to 'Good'  
> 15:21:46.465 [AWT-EventQueue-0] INFO vision.App -- Starting Up...  
> keystroke Key: F1, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F2, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F3, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F4, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F5, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F6, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F7, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F8, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F9, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F10, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F11, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F12, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F1, ctrl:False, alt: False, shift:False, action: Pressed.  
> Action performed on button: btnTest, on window: Main.  
> keystroke Key: F1, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F2, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F3, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F5, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F7, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F8, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F9, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F10, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F11, ctrl:True, alt: False, shift:False, action: Pressed.  
> keystroke Key: F12, ctrl:True, alt: False, shift:False, action: Pressed.

I'm running this project on 8.1.44 and now imported it on 8.3.4, same results...  
Any help/ideas anyone?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [March 11, 2026, 3:59pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930/3 "2026-03-11T15:59:58Z")

</div>

Sounds like the Focusable property on the button is set to True.

Can you try to turn that off and test again?

---

<div class="post-metadata">

**Author:** ![JantjeBeton](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JantjeBeton](https://forum.inductiveautomation.com/u/JantjeBeton)\
**Post date:** [March 12, 2026, 3:46pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930/4 "2026-03-12T15:46:00Z")

</div>

Well I'll be %&&^%&!  
This works. So in order for the project-wide navigation keys to keep functioning, I'll have to disable all focusable-properties!?

Thank you very, very much for this insight! 👍

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 12, 2026, 3:58pm UTC](https://forum.inductiveautomation.com/t/vision-client-keystroke-scripts-and-f2/113930/5 "2026-03-12T15:58:26Z")

</div>

You might be able to do something global (without requiring individual component changes) by accessing the KeyboardFocusManager:

> **[Set - KeyboardFocusManager (Java SE 21 & JDK 21)](https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/KeyboardFocusManager.html#setDefaultFocusTraversalKeys(int,java.util.Set))**
>
> If a SecurityManager is installed, the calling thread must be granted the AWTPermission "replaceKeyboardFocusManager" in order to replace the the current KeyboardFocusManager. If this permission is not granted, this method will throw a...

> [@Check which component has focus](https://forum.inductiveautomation.com/t/check-which-component-has-focus/21297/2):
>
> from java.awt import KeyboardFocusManager focusedComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()
