We'll start with the simple one, then in a later lesson introduce a slightly more complex, but much more powerful method.
We also define our handler function. The function automatically gets called with a parameter, and we'll choose to call it "MyEvent". It will come pre-loaded with information about the event.
The type of information you get in an event parameter depends on what sort of event it is. For a mouseclick, it would be the x-y position of the mousepointer, and which button was clicked. For a keydown event, it holds the keyCode.
|