The returned KeyStroke will correspond to a key press. Returns: a KeyStroke object for that key See Also: Parameters: ke圜ode - an int specifying the numeric code for a keyboard key modifiers - a bitwise-ored combination of any modifiers onKeyRelease - true if the KeyStroke should representĪ key release false otherwise. The modifiers consist of any combination of: For example:Īlternatively, the key code may be obtained by calling The "virtual key" constants defined in can be Set of modifiers, specifying whether the key is activated when it is Returns a shared instance of a KeyStroke, given a numeric key code and a Parameters: ke圜har - the Character object for a keyboard character modifiers - a bitwise-ored combination of any modifiers Returns: an KeyStroke object for that key Throws: IllegalArgumentException - if ke圜har is null Since: 1.3 See Also: Them is an integer in which each bit represents a different modifier Since these numbers are all different powers of two, any combination of .ALT_GRAPH_MASKĪlso can be used, but they are mapped to _DOWN_ modifiers.The old modifiers listed below also can be used, but they are The modifiers consist of any combination of following: This is to avoid inadvertent clashes with calls to Note that the first parameter is of type Character That represents a KEY_TYPED event for the Has been added to the java.beans package. The current serialization support isĪppropriate for short term storage or RMI between applications running Serialized objects of this class will not be compatible withįuture Swing releases. These factory methods allow the KeyStroke implementation to cache Client code cannotĬreate a KeyStroke a variant of getKeyStroke must be used KeyStrokes are immutable, and are intended to be unique. Interested in, those keystrokes you care about automatically initiateĪctions on the Components with which they are registered. Of trapping every keystroke and throwing away the ones you are not KeyStrokes are used to define high-level (semantic) action events. In all cases, KeyStrokes can specify modifiers (alt, shift,Ĭontrol, meta, altGraph, or a combination thereof) which must be present during the Key, just as KEY_PRESSED and KEY_RELEASED KeyEvents do alternately, theyĬan correspond to typing a specific Java character, just as KEY_TYPED KeyStrokes can correspond to only a press or release of a particular A KeyStroke represents a key action on the keyboard, or equivalent inputĭevice.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |