Copy link to clipboard
Copied
Hey,
For some reason, ScriptUI.environment.keyboardState.keyName is not working. Yesterday it worked just fine, but today it returns "undefined" for every key. Here is the code I'm using to test it:
var w = new Window("palette");
w.add("statictext", undefined, "detect key");
w.center();
w.show();
w.addEventListener('keydown', alertKey);
function alertKey(){
var keyState = ScriptUI.environment.keyboardState;
alert(keyState.keyName); // undefined
};
I'm using Windows, and other instances of that object (such as the .shiftKey, .ctrlKey and .altKey) work fine.
Thanks!
Copy link to clipboard
Copied
Just gave a quick test on latest AE v18.0 and keyName seems to work just fine on OSx. It only returns undefined on shift/cmd/alt clicks, but works ok on any other key.
Copy link to clipboard
Copied
I don't know, for me keyName still returns undefined for every key. Do you think it has to do with the new AE update?