On my scriptUI panel, I have a button. How can I detect whether the user is holding the shift
key when they click on the button?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can add an eventListener to your button.
var win = new Window ("dialog");
win.aButton = win.add ("button", undefined, "Button");
win.aButton.addEventListener ("click", function (k) {
if (k.shiftKey) {
alert("foo");
}else{
alert("bah");
}
});
win.show ();