Re: basic DOM event handling

Alex Russell <[email protected]> Sun, 17 Apr 2005 22:41:01 -0700
Newsgroups gmane.comp.windows.devel.netwindows
Organization dojotoolkit.org
Message-ID <[email protected]>
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So the keypress and keyup events are handled (and clobbered) by the=20
top-level widget object in netWindows, which allows widgets and=20
components the ability to register a handler on any key combination.=20
Here's the way the new tree widget captures the "up" key:

	this.setKeystroke("up", false, false, false, this, "focusPrev");

The mechanics to actually handle the collection, supression, and=20
dispersal of keystroke events is somewhat scattered, but you can start=20
to see it in environ_core.js.

I wish this topic were less complicated, so perhaps my best advice to=20
you is to perhaps start by trying to catch some other type of DOM event=20
w/ __sig__ instead of keystrokes, and leave the pain of normalizing all=20
of the key combinations to NW =3D )

Regards

On Sunday 17 April 2005 5:25 pm, Michael Franklin wrote:
> Ok, so I spotted the first bug in my code.  The second argument to
> __sig__.connect should reference the object that has the event
> handler.
>
> Then I looked at what ta.onkeyup eval'd to:
>
> function onkeyup(event) {
> __sig__.emit(__components__.getComponentFromNode(this).checkExpand,
> this.value, event); }
>
> I thought onkeyPress might be a better candidate:
> function onkeypress(event) {
> __sig__.emit(__components__.getComponentFromNode(this).valueChange,
> this.value, event); }
>
> This suggested that I should make myTest() take some parameters.  I
> read that if the slot doesn't have the right number of parameters
> [determined by the signal] it won't be called, right?  So I tried
> 0,1,2 parameters, but still nothing.
>
> Your help is appreciated.
>
> Michael
>
>
> _______________________________________________
> The netWindows developers list: [email protected]
> http://netwindows.org/mailman/listinfo/devel_netwindows.org

=2D --=20
Alex Russell
[email protected] BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
[email protected]  F687 1964 1EF6 453E 9BD0 5148 A15D 1D43 AB92 9A46
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCY0hyz3jiQlnDlyMRAgIxAJ9ezPiIp+fCxaKc5SKetLiQkk76UwCfcDEd
94ql7GFO1R/3HFCHOLamcvM=3D
=3DM0dO
=2D----END PGP SIGNATURE-----


_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org