0% found this document useful (0 votes)
94 views1 page

Control Events: - Computer Programming

The keydown event system handles keyboard input differently than mouse events. It bubbles the keydown event up through parent controls to allow multiple controls to handle different keys. If no control handles the key, the event recurses through all controls. If still unhandled, it sends to the root control's handler. The keyup system will be updated to direct the event to the control that handled the corresponding keydown. Mouse events may also be updated to fallback to the root handler if unclaimed, similar to key events.

Uploaded by

oanadragan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views1 page

Control Events: - Computer Programming

The keydown event system handles keyboard input differently than mouse events. It bubbles the keydown event up through parent controls to allow multiple controls to handle different keys. If no control handles the key, the event recurses through all controls. If still unhandled, it sends to the root control's handler. The keyup system will be updated to direct the event to the control that handled the corresponding keydown. Mouse events may also be updated to fallback to the root handler if unclaimed, similar to key events.

Uploaded by

oanadragan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#1|1

Control events
-computer programming-


The keydown system is a bit different (to mousemoveevent) in that it effectively needs to handle dozens of
different events (keys) not just one piece of info (the new relative mouse coord). As such, it bubbles the event
to parent controls of the focused one, so you can distribute handling of multiple keys, if you return false from
your keydown handler (i.e. didn't claim that keydown, note no 'event' at the end of a handler hook).

If nothing handles the key, it'll recurse the event (not the handling) through all the controls to give special
ones the opportunity to hook/override the handler itself. Its last difference (to mousemove/event) is that if
nothing else handles the call (and nothing is focused or focus has been nulled) it finally will send the event to
the handler of the root control i.e. the (outer) skin (technically to anything in the hierarchy with a null parent).
The keyup system works the same for the moment, but I'll be adding a mechanism to direct the keyup at
whichever control claimed the keydown (this morning possibly).

It will then work in a manner similar to mouse/menu(middle button or left hold)/rmouse down/up (i think). I'll
probably add the fallback-to-root control mechanism to the mousemove event system too, i.e. if the move is
not captured or claimed it'll trigger the root handler (who could inspect captured and clicked to see the
situation that caused it, note these will never get to child controls so they can behave naively). This will be
useful for roll over hints on mouse-based systems, perhaps other things too.

You might also like