How to disable UI events in javascript (but let them fire when dispatchEvent is called)? -


i developing javascript game. has pretty complex ui requiring lot of user interaction able make move. developing ai game can played against computer. thinking of programatically raising events using dispatchevent method drive ui when computer playing game, run problem if user starts interacting ui - mess game. there pattern followed people developing javascript games take care of problem?

let's have set of event handlers - onmousedown, onmousemove, onmouseup etc. both human player , computer use these handlers make move. human player relies on manually interacting app, whereas computer invokes these handlers via dispatchevent method. when computer's turn, need way tell js: don't want invoke these handlers on manual ui interaction. invoke them in response dispatchevent

you try attaching meta data dispatchevent id's event being raised computer.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -