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 ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.