1 person found this helpful
just tested your script with InDesign CS6 v 8.1.0 and CC v 9.3.0 on Mac OS X 10.6.8.
InDesign CS6 v 8.1.0 : All is working as expected.
InDesign CC v 9.3.0 : No way. The event did not fire or the listener cannot listen.
I suspect a bug in CC and above.
Thanks Uwe, I will have to start moving and clicking the mouse again
I might report it on the 'Adobe Bug Report Form' but it may it be too small fry for them to worry about.
also did a little experiment where I included an edittext field that is active and not visible.
In this case the keyboard events can be detected.
That's no valid workaround, because this would only work as long as the invisible edittext field is active.
( It will not be active anymore if the user clicks in the gray area of the main ScriptUI window. )
All tests currently done on OS X 10.6.8.
I should have added, that I did this experiment (mis)using an edittext field with a "palette" type of window.
And not with a "dialog" one.
which I did with no more success. Ahhh ScriptUI
> I might report it on the 'Adobe Bug Report Form' but it may it be too small fry for them to worry about.
Do report it. It's not small fry. Any bug is a bug. If Adobe aren't told about these things, nothing happens. The more people complain the better.
This issue is not only with "keydown", it's also with "keyup".
In the meanwhile I also tested with window type "window":
"panel" and "window" type ScriptUI windows in CC v 9.3.0 with an edittext field, visible or invisible:
If the listening mechanism stops it helps to switch to a different app and coming back to InDesign. As soon as the window gets focus and is active the listeners for "keydown" and "keyup" are working again. Event target is [object Edittext].
"palette" type ScriptUI windows in CC v 9.3.0 with an edittext field, visible or invisible:
If the listening mechanism stops I can get back access to the listening mechanism after clicking somewhere else out of the ScriptUI window and to click the title bar of the ScriptUI window. I do not have to switch to a different app. Event target is [object Edittext].
So having an edittext field somewhere in the window could be a "little workaround".