O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event Modifier Constants

In addition to an id field, each java.awt.Event also contains a modifier field that provides additional information about the event. For example, you might want to know which key or which mouse button triggered an event. The Event class defines a handful of constants that provide such information. Table 8-6 lists the modifier constants. We'll show how to use these later in this chapter, but it's useful to have them handy for reference.

Table 8-6. Event Modifiers
Event Modifier Constant Type Meaning
ALT_MASK Keyboard ALT key is down.
ALT_MASK Mouse Button Button 2 is pressed.
CTRL_MASK Keyboard CONTROL key is down.
DOWN Function Key DOWN key is pressed.
END Function Key END key is pressed.
F1 - F12 Function Key FUNCTION ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required