Hi Pedro, that's very close, thanks! At least on CC2015.5 there is a drawback, see this one: That is, the Listener doesn't seem to be attached to, or affect the, whole Window, but the Button only – i.e. if ALT is pressed when the mouse pointer is not on the Button, nothing happens (while it should) Moreover, if you ALT then mouseOver (Cancel -> Reset), then while ALT is pressed you mouseOut, then release ALT, the text remains Reset (should become Cancel). We all love ScriptUI 😉 The code I've used: var res = """dialog { orientation: 'column', okButton: Button { text: 'OK' }, cancelButton: Button { text: 'Cancel' }, }"""; var win = new Window(res); var mouseEventHandler = function(ev) { if (ScriptUI.environment.keyboardState.altKey) { win.cancelButton.text = 'Reset'; // you can see the event type changing on the reset button text } else { win.cancelButton.text = 'Cancel' } }; // Register the mouse event handler win.addEventListener('mouseover', mouseEventHandler); win.addEventListener('mouseout', mouseEventHandler); win.addEventListener('mousemove', mouseEventHandler); // these 2 are not so important: it only works 1 time and then always be mousemove when scrooling: win.addEventListener('mousedown', mouseEventHandler); win.addEventListener('mouseup', mouseEventHandler); // there is no other option when loosing the Window focus win.show() Thanks again,
... View more