[Ur] Access to event object on onclick/et al

Vladimir Shabanov vshabanoff at gmail.com
Sun May 20 06:00:39 EDT 2012


2012/5/20 Edward Z. Yang <ezyang at mit.edu>:
> I'd like to implement different behavior in the case that the shift-key is
> pressed down and a user clicks on an element, as opposed when nothing is
> pressed down.  It is well known that event objects have a shiftKey attribute
> which contains precisely this information.  However, Ur/Web event handlers
> have no access to the event object.  To add insult to injury, there isn't
> any way to FFI access to the event object either.

There is uw_event javascript variable which keeps current event
handler parameter.
For accessing event in js FFI you could use something like
  var e = window.event ? window.event : uw_event;



More information about the Ur mailing list