[JS SUI] How to set enter key event in listbox?
var w = new window ("dialog"); var mylist = w.add ("listbox", undefined, ["one", "two", "three"]); mylist.addeventlistener ("keydown", function (kd) {pressed (kd)}); function pressed (k) { if(k.keyname == "enter") { var idx = mylist.selection.index; alert(idx); } } w.show ();
hi.
only enter key event not working in script.
i want occur enter key event , index of listbox item.
any ideas?
thanks.
hi,
try ...
var w = new window ("dialog"); var mylist = w.add ("listbox", undefined, ["one", "two", "three"]); w.addeventlistener ("keydown", function (kd) {pressed (kd)}); function pressed (k) { if(k.keyname == "enter") { var idx = mylist.selection.index; alert(idx); } } w.show ();
regards
More discussions in InDesign Scripting
adobe
Comments
Post a Comment