From: Bruce S. <Bru...@nc...> - 2012-05-21 18:53:03
|
I can't think of a way to do that within the existing structure. I'll mention that in the new GlowScript (glowscript.org: JavaScript/CoffeeScript plus WebGl, based on the VPython design), events are handled with callbacks. Bruce Sherwood On Mon, May 21, 2012 at 12:30 PM, Sophie <its...@ho...> wrote: > Is there any way to do event-driven programming, with callbacks for mouse or keyboard events? I would rather not use the polling style shown in example on the web site. > > e.g. > > onKey('a', processKeyA) > > onMouseDown(processMouseDown) > > onMouseDownOn(myCube, processMouseDownOnObject) > > Thanks! |