close a popup cliking on ECHAP

{ view:"button", label: 'Close', width: 100, align: 'right', click:function(){			
				$$("popup id").close();
				 }, 
			 }

currently I can close my popup cliking on “close” button which call popid and then close it.

But I wish to add an advanced functionality, adding also keyboard event to close my pop up. may you help me ?

I’ve ever looked at keyboard events but in my case I must have to developp two way closing my popup.

it’s seems difficult

Just use a hotkey attribute for the button

{ view:"button", hotkey:"Enter"

it’s work fine but if a click several times on Enter, popup are opened on top of each other. It would be much better to add something to prevent this. can we do this ?

please help

hotkey handler will just run onclick code, each time when hotkey is pressed. So it has nothing to do with visibility of result popup.

In code which creates|shows popup you can check is popup already visible and ignore such calls.

thanks, I did it with a simple boolean