# Problem using Global Event Keystroke

**URL:** <https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392>\
**Category:** Archived Topics\
**Created:** [November 30, 2009, 5:20pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392 "2009-11-30T17:20:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [November 30, 2009, 5:20pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/1 "2009-11-30T17:20:54Z")

</div>

I’m trying to launch a particular window whenever a key is pressed, by putting fpmi.nav.windowName in a Global Event Keystroke script. I’ve found that the key press doesn’t work unless the user first interacts with a control on the window or clicks on the runtime menu bar at the top of the window first.

Is there any way to correct this behaviour?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 30, 2009, 9:13pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/2 "2009-11-30T21:13:08Z")

</div>

You mean after they login, but before they click on anything, the key actions don’t fire?

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [November 30, 2009, 9:16pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/3 "2009-11-30T21:16:28Z")

</div>

After they open a window, they have to interact with it (or the menu bar) in some way before the key actions fire.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 30, 2009, 9:24pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/4 "2009-11-30T21:24:46Z")

</div>

hrm…I’ll have to replicate this and investigate. You can try to programatically give input focus to the window in the internalFrameActivated script using event.source.requestFocusInWindow()

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [November 30, 2009, 9:48pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/5 "2009-11-30T21:48:19Z")

</div>

This only seems to be a problem when launching a system as an applet (Firefox and IE8).

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 30, 2009, 11:27pm UTC](https://forum.inductiveautomation.com/t/problem-using-global-event-keystroke/1392/6 "2009-11-30T23:27:04Z")

</div>

Ah, that makes sense. Applet mode has been known to act a bit differently than the traditional launch mode. In this case, my guess is that the browser itself is getting the keyboard input until the user directs it to the applet by clicking inside. If this is the case, it might be hard for us to “fix”. We’ll look into it.
