I have a key combination ctrl+a that does some work in 3-10 seconds.During that period of time ,i want ,if user presses the same key [or any key-optional] ,the request shall not be taken.What right now happens is the request is queued and executes in order of how all the requests came.Following is how i am listening on keystrokes
win.setCtrlKeys("@b@g@i@k@l@n@o@p@r@s@u^x^a^c^z^1^2^#up^#down");
win.addEventListener("onCtrlKey", keylistener);
keylistener takes 2-10 seconds.Is it possible in ZKOSS?I tried deferrable listeners but that completely delays the events until a non-deferrable event is fired.
Question also asked : http://forum.zkoss.org/question/101508/disable-multiple-pressing-on-a-keystroke-untill-previous-request-completes/
I suggest removing or disabling your eventhandler for the keys in the first place.
After that, you echo an event that will trigger the effective business logic.
The reason for echoing is that the disabling key's will be propagated to the client before beginning the business logic. When the bussines logic is done, you can enable or add the eventlistener for the keys again.