jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java
author martin
Thu, 30 Oct 2014 07:31:41 -0700
changeset 28059 e576535359cc
parent 26749 b6598aa90114
child 35667 ed476aba94de
permissions -rw-r--r--
8067377: My hobby: caning, then then canning, the the can-can Summary: Fix ALL the stutters! Reviewed-by: rriggs, mchung, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
     2
 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2473
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2473
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2473
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2473
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2473
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.awt.event;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.GraphicsEnvironment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.Toolkit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.ObjectInputStream;
13604
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
    33
import sun.awt.AWTAccessor;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * An event which indicates that a keystroke occurred in a component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * This low-level event is generated by a component object (such as a text
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * field) when a key is pressed, released, or typed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * The event is passed to every <code>KeyListener</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * or <code>KeyAdapter</code> object which registered to receive such
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * events using the component's <code>addKeyListener</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * (<code>KeyAdapter</code> objects implement the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <code>KeyListener</code> interface.)  Each such listener object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * gets this <code>KeyEvent</code> when the event occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <em>"Key typed" events</em> are higher-level and generally do not depend on
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * the platform or keyboard layout.  They are generated when a Unicode character
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * is entered, and are the preferred way to find out about character input.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * In the simplest case, a key typed event is produced by a single key press
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * (e.g., 'a').  Often, however, characters are produced by series of key
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * presses (e.g., 'shift' + 'a'), and the mapping from key pressed events to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * key typed events may be many-to-one or many-to-many.  Key releases are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * usually necessary to generate a key typed event, but there are some cases
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * where the key typed event is not generated until a key is released (e.g.,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * entering ASCII sequences via the Alt-Numpad method in Windows).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * No key typed events are generated for keys that don't generate Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * characters (e.g., action keys, modifier keys, etc.).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * The getKeyChar method always returns a valid Unicode character or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * CHAR_UNDEFINED.  Character input is reported by KEY_TYPED events:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * KEY_PRESSED and KEY_RELEASED events are not necessarily associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * with character input.  Therefore, the result of the getKeyChar method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * is guaranteed to be meaningful only for KEY_TYPED events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * For key pressed and key released events, the getKeyCode method returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * the event's keyCode.  For key typed events, the getKeyCode method
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
    68
 * always returns {@code VK_UNDEFINED}. The {@code getExtendedKeyCode} method
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
    69
 * may also be used with many international keyboard layouts.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <em>"Key pressed" and "key released" events</em> are lower-level and depend
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * on the platform and keyboard layout. They are generated whenever a key is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * pressed or released, and are the only way to find out about keys that don't
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * generate character input (e.g., action keys, modifier keys, etc.). The key
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
    76
 * being pressed or released is indicated by the {@code getKeyCode} and {@code getExtendedKeyCode}
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
    77
 * methods, which return a virtual key code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * <em>Virtual key codes</em> are used to report which keyboard key has
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * been pressed, rather than a character generated by the combination
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * of one or more keystrokes (such as "A", which comes from shift and "a").
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * For example, pressing the Shift key will cause a KEY_PRESSED event
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * with a VK_SHIFT keyCode, while pressing the 'a' key will result in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * a VK_A keyCode.  After the 'a' key is released, a KEY_RELEASED event
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * will be fired with VK_A. Separately, a KEY_TYPED event with a keyChar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * value of 'A' is generated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * Pressing and releasing a key on the keyboard results in the generating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * the following key events (in order):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 *    {@code KEY_PRESSED}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 *    {@code KEY_TYPED} (is only generated if a valid Unicode character could be generated.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 *    {@code KEY_RELEASED}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * But in some cases (e.g. auto-repeat or input method is activated) the order
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * could be different (and platform dependent).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * Notes:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * <li>Key combinations which do not result in Unicode characters, such as action
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * keys like F1 and the HELP key, do not generate KEY_TYPED events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * <li>Not all keyboards or systems are capable of generating all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * virtual key codes.  No attempt is made in Java to generate these keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * artificially.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * <li>Virtual key codes do not identify a physical key: they depend on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * platform and keyboard layout. For example, the key that generates VK_Q
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * when using a U.S. keyboard layout will generate VK_A when using a French
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * keyboard layout.
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
   115
 * <li>The key that generates {@code VK_Q} when using a U.S. keyboard layout also
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
   116
 * generates a unique code for Russian or Hebrew layout. There is no a
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
   117
 * {@code VK_} constant for these and many other codes in various layouts. These codes
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
   118
 * may be obtained by using {@code getExtendedKeyCode} and are used whenever
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
   119
 * a {@code VK_} constant is used.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * <li>Not all characters have a keycode associated with them.  For example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * there is no keycode for the question mark because there is no keyboard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * for which it appears on the primary layer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * <li>In order to support the platform-independent handling of action keys,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * the Java platform uses a few additional virtual key constants for functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * that would otherwise have to be recognized by interpreting virtual key codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * and modifiers. For example, for Japanese Windows keyboards, VK_ALL_CANDIDATES
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * is returned instead of VK_CONVERT with the ALT modifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * <li>As specified in <a href="../doc-files/FocusSpec.html">Focus Specification</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * key events are dispatched to the focus owner by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 * WARNING: Aside from those keys that are defined by the Java language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 * (VK_ENTER, VK_BACK_SPACE, and VK_TAB), do not rely on the values of the VK_
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   135
 * constants.  The platform steward reserves the right to change these values as needed
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20455
diff changeset
   136
 * to accommodate a wider range of keyboards in the future.
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   137
 * <p>
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   138
 * An unspecified behavior will be caused if the {@code id} parameter
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   139
 * of any particular {@code KeyEvent} instance is not
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   140
 * in the range from {@code KEY_FIRST} to {@code KEY_LAST}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * @author Carl Quinn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * @author Amy Fowler
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * @author Norbert Lindenberg
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 * @see KeyAdapter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 * @see KeyListener
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 14310
diff changeset
   148
 * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html">Tutorial: Writing a Key Listener</a>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 * @since 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
public class KeyEvent extends InputEvent {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * Stores the state of native event dispatching system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * - true, if when the event was created event proxying
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *         mechanism was active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * - false, if it was inactive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * Used in Component.dispatchEventImpl to correctly dispatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * events when proxy is active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    private boolean isProxyActive = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * The first number in the range of ids used for key events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    public static final int KEY_FIRST = 400;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * The last number in the range of ids used for key events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public static final int KEY_LAST  = 402;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * The "key typed" event.  This event is generated when a character is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * entered.  In the simplest case, it is produced by a single key press.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * Often, however, characters are produced by series of key presses, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * the mapping from key pressed events to key typed events may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * many-to-one or many-to-many.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    public static final int KEY_TYPED = KEY_FIRST;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * The "key pressed" event. This event is generated when a key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * is pushed down.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public static final int KEY_PRESSED = 1 + KEY_FIRST; //Event.KEY_PRESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * The "key released" event. This event is generated when a key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * is let up.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    public static final int KEY_RELEASED = 2 + KEY_FIRST; //Event.KEY_RELEASE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /* Virtual key codes. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   197
    /** Constant for the ENTER virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    public static final int VK_ENTER          = '\n';
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   199
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   200
    /** Constant for the BACK_SPACE virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public static final int VK_BACK_SPACE     = '\b';
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   202
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   203
    /** Constant for the TAB virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public static final int VK_TAB            = '\t';
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   205
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   206
    /** Constant for the CANCEL virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public static final int VK_CANCEL         = 0x03;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   208
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   209
    /** Constant for the CLEAR virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public static final int VK_CLEAR          = 0x0C;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   211
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   212
    /** Constant for the SHIFT virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    public static final int VK_SHIFT          = 0x10;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   214
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   215
    /** Constant for the CONTROL virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    public static final int VK_CONTROL        = 0x11;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   217
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   218
    /** Constant for the ALT virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public static final int VK_ALT            = 0x12;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   220
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   221
    /** Constant for the PAUSE virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    public static final int VK_PAUSE          = 0x13;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   223
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   224
    /** Constant for the CAPS_LOCK virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    public static final int VK_CAPS_LOCK      = 0x14;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   226
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   227
    /** Constant for the ESCAPE virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public static final int VK_ESCAPE         = 0x1B;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   229
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   230
    /** Constant for the SPACE virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    public static final int VK_SPACE          = 0x20;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   232
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   233
    /** Constant for the PAGE_UP virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public static final int VK_PAGE_UP        = 0x21;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   235
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   236
    /** Constant for the PAGE_DOWN virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public static final int VK_PAGE_DOWN      = 0x22;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   238
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   239
    /** Constant for the END virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    public static final int VK_END            = 0x23;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   241
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   242
    /** Constant for the HOME virtual key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public static final int VK_HOME           = 0x24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * Constant for the non-numpad <b>left</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @see #VK_KP_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public static final int VK_LEFT           = 0x25;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Constant for the non-numpad <b>up</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @see #VK_KP_UP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    public static final int VK_UP             = 0x26;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * Constant for the non-numpad <b>right</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @see #VK_KP_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    public static final int VK_RIGHT          = 0x27;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * Constant for the non-numpad <b>down</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @see #VK_KP_DOWN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    public static final int VK_DOWN           = 0x28;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * Constant for the comma key, ","
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    public static final int VK_COMMA          = 0x2C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * Constant for the minus key, "-"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    public static final int VK_MINUS          = 0x2D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * Constant for the period key, "."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    public static final int VK_PERIOD         = 0x2E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * Constant for the forward slash key, "/"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    public static final int VK_SLASH          = 0x2F;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /** VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   291
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   292
    /** Constant for the "0" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    public static final int VK_0              = 0x30;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   294
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   295
    /** Constant for the "1" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    public static final int VK_1              = 0x31;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   297
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   298
    /** Constant for the "2" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    public static final int VK_2              = 0x32;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   300
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   301
    /** Constant for the "3" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    public static final int VK_3              = 0x33;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   303
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   304
    /** Constant for the "4" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public static final int VK_4              = 0x34;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   306
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   307
    /** Constant for the "5" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    public static final int VK_5              = 0x35;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   309
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   310
    /** Constant for the "6" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    public static final int VK_6              = 0x36;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   312
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   313
    /** Constant for the "7" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    public static final int VK_7              = 0x37;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   315
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   316
    /** Constant for the "8" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    public static final int VK_8              = 0x38;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   318
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   319
    /** Constant for the "9" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    public static final int VK_9              = 0x39;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * Constant for the semicolon key, ";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public static final int VK_SEMICOLON      = 0x3B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * Constant for the equals key, "="
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    public static final int VK_EQUALS         = 0x3D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    /** VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   333
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   334
    /** Constant for the "A" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public static final int VK_A              = 0x41;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   336
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   337
    /** Constant for the "B" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    public static final int VK_B              = 0x42;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   339
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   340
    /** Constant for the "C" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    public static final int VK_C              = 0x43;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   342
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   343
    /** Constant for the "D" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public static final int VK_D              = 0x44;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   345
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   346
    /** Constant for the "E" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    public static final int VK_E              = 0x45;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   348
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   349
    /** Constant for the "F" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    public static final int VK_F              = 0x46;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   351
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   352
    /** Constant for the "G" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    public static final int VK_G              = 0x47;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   354
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   355
    /** Constant for the "H" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    public static final int VK_H              = 0x48;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   357
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   358
    /** Constant for the "I" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    public static final int VK_I              = 0x49;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   360
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   361
    /** Constant for the "J" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    public static final int VK_J              = 0x4A;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   363
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   364
    /** Constant for the "K" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    public static final int VK_K              = 0x4B;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   366
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   367
    /** Constant for the "L" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    public static final int VK_L              = 0x4C;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   369
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   370
    /** Constant for the "M" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public static final int VK_M              = 0x4D;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   372
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   373
    /** Constant for the "N" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    public static final int VK_N              = 0x4E;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   375
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   376
    /** Constant for the "O" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    public static final int VK_O              = 0x4F;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   378
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   379
    /** Constant for the "P" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    public static final int VK_P              = 0x50;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   381
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   382
    /** Constant for the "Q" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public static final int VK_Q              = 0x51;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   384
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   385
    /** Constant for the "R" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public static final int VK_R              = 0x52;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   387
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   388
    /** Constant for the "S" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    public static final int VK_S              = 0x53;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   390
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   391
    /** Constant for the "T" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    public static final int VK_T              = 0x54;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   393
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   394
    /** Constant for the "U" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    public static final int VK_U              = 0x55;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   396
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   397
    /** Constant for the "V" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    public static final int VK_V              = 0x56;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   399
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   400
    /** Constant for the "W" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    public static final int VK_W              = 0x57;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   402
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   403
    /** Constant for the "X" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    public static final int VK_X              = 0x58;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   405
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   406
    /** Constant for the "Y" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    public static final int VK_Y              = 0x59;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   408
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   409
    /** Constant for the "Z" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    public static final int VK_Z              = 0x5A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * Constant for the open bracket key, "["
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    public static final int VK_OPEN_BRACKET   = 0x5B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * Constant for the back slash key, "\"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    public static final int VK_BACK_SLASH     = 0x5C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * Constant for the close bracket key, "]"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    public static final int VK_CLOSE_BRACKET  = 0x5D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   427
    /** Constant for the number pad "0" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    public static final int VK_NUMPAD0        = 0x60;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   429
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   430
    /** Constant for the number pad "1" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    public static final int VK_NUMPAD1        = 0x61;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   432
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   433
    /** Constant for the number pad "2" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    public static final int VK_NUMPAD2        = 0x62;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   435
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   436
    /** Constant for the number pad "3" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    public static final int VK_NUMPAD3        = 0x63;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   438
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   439
    /** Constant for the number pad "4" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public static final int VK_NUMPAD4        = 0x64;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   441
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   442
    /** Constant for the number pad "5" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    public static final int VK_NUMPAD5        = 0x65;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   444
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   445
    /** Constant for the number pad "6" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    public static final int VK_NUMPAD6        = 0x66;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   447
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   448
    /** Constant for the number pad "7" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    public static final int VK_NUMPAD7        = 0x67;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   450
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   451
    /** Constant for the number pad "8" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    public static final int VK_NUMPAD8        = 0x68;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   453
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   454
    /** Constant for the number pad "9" key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    public static final int VK_NUMPAD9        = 0x69;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   456
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   457
    /** Constant for the number pad multiply key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
    public static final int VK_MULTIPLY       = 0x6A;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   459
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   460
    /** Constant for the number pad add key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    public static final int VK_ADD            = 0x6B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * This constant is obsolete, and is included only for backwards
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * @see #VK_SEPARATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    public static final int VK_SEPARATER      = 0x6C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * Constant for the Numpad Separator key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    public static final int VK_SEPARATOR      = VK_SEPARATER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   476
    /** Constant for the number pad subtract key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    public static final int VK_SUBTRACT       = 0x6D;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   478
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   479
    /** Constant for the number pad decimal point key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    public static final int VK_DECIMAL        = 0x6E;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   481
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   482
    /** Constant for the number pad divide key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    public static final int VK_DIVIDE         = 0x6F;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   484
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   485
    /** Constant for the delete key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
    public static final int VK_DELETE         = 0x7F; /* ASCII DEL */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   487
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   488
    /** Constant for the NUM_LOCK key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    public static final int VK_NUM_LOCK       = 0x90;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   490
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   491
    /** Constant for the SCROLL_LOCK key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
    public static final int VK_SCROLL_LOCK    = 0x91;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    /** Constant for the F1 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    public static final int VK_F1             = 0x70;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
    /** Constant for the F2 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    public static final int VK_F2             = 0x71;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
    /** Constant for the F3 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
    public static final int VK_F3             = 0x72;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    /** Constant for the F4 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
    public static final int VK_F4             = 0x73;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
    /** Constant for the F5 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
    public static final int VK_F5             = 0x74;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    /** Constant for the F6 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
    public static final int VK_F6             = 0x75;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
    /** Constant for the F7 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
    public static final int VK_F7             = 0x76;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
    /** Constant for the F8 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    public static final int VK_F8             = 0x77;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
    /** Constant for the F9 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
    public static final int VK_F9             = 0x78;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
    /** Constant for the F10 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
    public static final int VK_F10            = 0x79;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
    /** Constant for the F11 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
    public static final int VK_F11            = 0x7A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    /** Constant for the F12 function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
    public static final int VK_F12            = 0x7B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * Constant for the F13 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
    /* F13 - F24 are used on IBM 3270 keyboard; use random range for constants. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
    public static final int VK_F13            = 0xF000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * Constant for the F14 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
    public static final int VK_F14            = 0xF001;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * Constant for the F15 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
    public static final int VK_F15            = 0xF002;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * Constant for the F16 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    public static final int VK_F16            = 0xF003;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * Constant for the F17 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    public static final int VK_F17            = 0xF004;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * Constant for the F18 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    public static final int VK_F18            = 0xF005;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * Constant for the F19 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    public static final int VK_F19            = 0xF006;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * Constant for the F20 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    public static final int VK_F20            = 0xF007;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * Constant for the F21 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
    public static final int VK_F21            = 0xF008;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * Constant for the F22 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    public static final int VK_F22            = 0xF009;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * Constant for the F23 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
    public static final int VK_F23            = 0xF00A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * Constant for the F24 function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
    public static final int VK_F24            = 0xF00B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   603
    /**  Constant for the PRINTSCREEN key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    public static final int VK_PRINTSCREEN    = 0x9A;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   605
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   606
    /**  Constant for the INSERT key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
    public static final int VK_INSERT         = 0x9B;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   608
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   609
    /**  Constant for the HELP key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    public static final int VK_HELP           = 0x9C;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   611
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   612
    /**  Constant for the META key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
    public static final int VK_META           = 0x9D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   615
    /**  Constant for the BACK_QUOTE  key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
    public static final int VK_BACK_QUOTE     = 0xC0;
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   617
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   618
    /**  Constant for the QUOTE key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
    public static final int VK_QUOTE          = 0xDE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * Constant for the numeric keypad <b>up</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @see #VK_UP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    public static final int VK_KP_UP          = 0xE0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     * Constant for the numeric keypad <b>down</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * @see #VK_DOWN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
    public static final int VK_KP_DOWN        = 0xE1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     * Constant for the numeric keypad <b>left</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * @see #VK_LEFT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
    public static final int VK_KP_LEFT        = 0xE2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * Constant for the numeric keypad <b>right</b> arrow key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * @see #VK_RIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
    public static final int VK_KP_RIGHT       = 0xE3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
    /* For European keyboards */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
    public static final int VK_DEAD_GRAVE               = 0x80;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
    public static final int VK_DEAD_ACUTE               = 0x81;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
    public static final int VK_DEAD_CIRCUMFLEX          = 0x82;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
    public static final int VK_DEAD_TILDE               = 0x83;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
    public static final int VK_DEAD_MACRON              = 0x84;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
    public static final int VK_DEAD_BREVE               = 0x85;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
    public static final int VK_DEAD_ABOVEDOT            = 0x86;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
    public static final int VK_DEAD_DIAERESIS           = 0x87;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
    public static final int VK_DEAD_ABOVERING           = 0x88;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
    public static final int VK_DEAD_DOUBLEACUTE         = 0x89;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
    public static final int VK_DEAD_CARON               = 0x8a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
    public static final int VK_DEAD_CEDILLA             = 0x8b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
    public static final int VK_DEAD_OGONEK              = 0x8c;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
    public static final int VK_DEAD_IOTA                = 0x8d;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
    public static final int VK_DEAD_VOICED_SOUND        = 0x8e;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
    public static final int VK_DEAD_SEMIVOICED_SOUND    = 0x8f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
    public static final int VK_AMPERSAND                = 0x96;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
    public static final int VK_ASTERISK                 = 0x97;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
    public static final int VK_QUOTEDBL                 = 0x98;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
    public static final int VK_LESS                     = 0x99;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
    public static final int VK_GREATER                  = 0xa0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
    public static final int VK_BRACELEFT                = 0xa1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
    public static final int VK_BRACERIGHT               = 0xa2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * Constant for the "@" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
    public static final int VK_AT                       = 0x0200;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * Constant for the ":" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
    public static final int VK_COLON                    = 0x0201;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * Constant for the "^" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
    public static final int VK_CIRCUMFLEX               = 0x0202;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     * Constant for the "$" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
    public static final int VK_DOLLAR                   = 0x0203;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * Constant for the Euro currency sign key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
    public static final int VK_EURO_SIGN                = 0x0204;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * Constant for the "!" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
    public static final int VK_EXCLAMATION_MARK         = 0x0205;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * Constant for the inverted exclamation mark key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
    public static final int VK_INVERTED_EXCLAMATION_MARK = 0x0206;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * Constant for the "(" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
    public static final int VK_LEFT_PARENTHESIS         = 0x0207;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     * Constant for the "#" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
    public static final int VK_NUMBER_SIGN              = 0x0208;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * Constant for the "+" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
    public static final int VK_PLUS                     = 0x0209;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * Constant for the ")" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
    public static final int VK_RIGHT_PARENTHESIS        = 0x020A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * Constant for the "_" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
    public static final int VK_UNDERSCORE               = 0x020B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * Constant for the Microsoft Windows "Windows" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * It is used for both the left and right version of the key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * @see #getKeyLocation()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
    public static final int VK_WINDOWS                  = 0x020C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * Constant for the Microsoft Windows Context Menu key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
    public static final int VK_CONTEXT_MENU             = 0x020D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
    /* for input method support on Asian Keyboards */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
    /* not clear what this means - listed in Microsoft Windows API */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   788
    /** Constant for the FINAL key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
    public static final int VK_FINAL                    = 0x0018;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
    /** Constant for the Convert function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
    /* Japanese PC 106 keyboard, Japanese Solaris keyboard: henkan */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
    public static final int VK_CONVERT                  = 0x001C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
    /** Constant for the Don't Convert function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
    /* Japanese PC 106 keyboard: muhenkan */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
    public static final int VK_NONCONVERT               = 0x001D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
    /** Constant for the Accept or Commit function key. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
    /* Japanese Solaris keyboard: kakutei */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
    public static final int VK_ACCEPT                   = 0x001E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
    /* not clear what this means - listed in Microsoft Windows API */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   804
    /** Constant for the MODECHANGE key. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
    public static final int VK_MODECHANGE               = 0x001F;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
    /* replaced by VK_KANA_LOCK for Microsoft Windows and Solaris;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
       might still be used on other platforms */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   809
    /**
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   810
     * Constant for the KANA lock key.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   811
     * @see #VK_KANA_LOCK
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   812
     **/
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
    public static final int VK_KANA                     = 0x0015;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
    /* replaced by VK_INPUT_METHOD_ON_OFF for Microsoft Windows and Solaris;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
       might still be used for other platforms */
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   817
    /**
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   818
     * Constant for KANJI.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   819
     * @see #VK_INPUT_METHOD_ON_OFF
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
   820
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
    public static final int VK_KANJI                    = 0x0019;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * Constant for the Alphanumeric function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
    /* Japanese PC 106 keyboard: eisuu */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
    public static final int VK_ALPHANUMERIC             = 0x00F0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * Constant for the Katakana function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
    /* Japanese PC 106 keyboard: katakana */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
    public static final int VK_KATAKANA                 = 0x00F1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * Constant for the Hiragana function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
    /* Japanese PC 106 keyboard: hiragana */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
    public static final int VK_HIRAGANA                 = 0x00F2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * Constant for the Full-Width Characters function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
    /* Japanese PC 106 keyboard: zenkaku */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
    public static final int VK_FULL_WIDTH               = 0x00F3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * Constant for the Half-Width Characters function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
    /* Japanese PC 106 keyboard: hankaku */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
    public static final int VK_HALF_WIDTH               = 0x00F4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * Constant for the Roman Characters function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
    /* Japanese PC 106 keyboard: roumaji */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
    public static final int VK_ROMAN_CHARACTERS         = 0x00F5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     * Constant for the All Candidates function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
    /* Japanese PC 106 keyboard - VK_CONVERT + ALT: zenkouho */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
    public static final int VK_ALL_CANDIDATES           = 0x0100;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     * Constant for the Previous Candidate function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
    /* Japanese PC 106 keyboard - VK_CONVERT + SHIFT: maekouho */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
    public static final int VK_PREVIOUS_CANDIDATE       = 0x0101;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * Constant for the Code Input function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
    /* Japanese PC 106 keyboard - VK_ALPHANUMERIC + ALT: kanji bangou */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
    public static final int VK_CODE_INPUT               = 0x0102;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * Constant for the Japanese-Katakana function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * This key switches to a Japanese input method and selects its Katakana input mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
    /* Japanese Macintosh keyboard - VK_JAPANESE_HIRAGANA + SHIFT */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
    public static final int VK_JAPANESE_KATAKANA        = 0x0103;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     * Constant for the Japanese-Hiragana function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     * This key switches to a Japanese input method and selects its Hiragana input mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
    /* Japanese Macintosh keyboard */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
    public static final int VK_JAPANESE_HIRAGANA        = 0x0104;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * Constant for the Japanese-Roman function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * This key switches to a Japanese input method and selects its Roman-Direct input mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
    /* Japanese Macintosh keyboard */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
    public static final int VK_JAPANESE_ROMAN           = 0x0105;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * Constant for the locking Kana function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * This key locks the keyboard into a Kana layout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
    /* Japanese PC 106 keyboard with special Windows driver - eisuu + Control; Japanese Solaris keyboard: kana */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
    public static final int VK_KANA_LOCK                = 0x0106;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * Constant for the input method on/off key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
    /* Japanese PC 106 keyboard: kanji. Japanese Solaris keyboard: nihongo */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
    public static final int VK_INPUT_METHOD_ON_OFF      = 0x0107;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
    /* for Sun keyboards */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
    public static final int VK_CUT                      = 0xFFD1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
    public static final int VK_COPY                     = 0xFFCD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
    public static final int VK_PASTE                    = 0xFFCF;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
    public static final int VK_UNDO                     = 0xFFCB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
    public static final int VK_AGAIN                    = 0xFFC9;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
    public static final int VK_FIND                     = 0xFFD0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
    public static final int VK_PROPS                    = 0xFFCA;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
    /** @since 1.2 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
    public static final int VK_STOP                     = 0xFFC8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * Constant for the Compose function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
    public static final int VK_COMPOSE                  = 0xFF20;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * Constant for the AltGraph function key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
    public static final int VK_ALT_GRAPH                = 0xFF7E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * Constant for the Begin key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
    public static final int VK_BEGIN                    = 0xFF58;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     * This value is used to indicate that the keyCode is unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * KEY_TYPED events do not have a keyCode value; this value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     * is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
    public static final int VK_UNDEFINED      = 0x0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * KEY_PRESSED and KEY_RELEASED events which do not map to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * valid Unicode character use this for the keyChar value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
    public static final char CHAR_UNDEFINED   = 0xFFFF;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * A constant indicating that the keyLocation is indeterminate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * or not relevant.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * <code>KEY_TYPED</code> events do not have a keyLocation; this value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
    public static final int KEY_LOCATION_UNKNOWN  = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     * A constant indicating that the key pressed or released
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * is not distinguished as the left or right version of a key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * and did not originate on the numeric keypad (or did not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * originate with a virtual key corresponding to the numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * keypad).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
    public static final int KEY_LOCATION_STANDARD = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * A constant indicating that the key pressed or released is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * the left key location (there is more than one possible location
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     * for this key).  Example: the left shift key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
    public static final int KEY_LOCATION_LEFT     = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     * A constant indicating that the key pressed or released is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * the right key location (there is more than one possible location
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * for this key).  Example: the right shift key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
    public static final int KEY_LOCATION_RIGHT    = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     * A constant indicating that the key event originated on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * numeric keypad or with a virtual key corresponding to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * numeric keypad.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
    public static final int KEY_LOCATION_NUMPAD   = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * The unique value assigned to each of the keys on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     * keyboard.  There is a common set of key codes that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * can be fired by most keyboards.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * The symbolic name for a key code should be used rather
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * than the code value itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     * @see #getKeyCode()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     * @see #setKeyCode(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
    int  keyCode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * <code>keyChar</code> is a valid unicode character
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     * that is fired by a key or a key combination on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * a keyboard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     * @see #getKeyChar()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     * @see #setKeyChar(char)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
    char keyChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     * The location of the key on the keyboard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
     * Some keys occur more than once on a keyboard, e.g. the left and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * right shift keys.  Additionally, some keys occur on the numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * keypad.  This variable is used to distinguish such keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * The only legal values are <code>KEY_LOCATION_UNKNOWN</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     * <code>KEY_LOCATION_STANDARD</code>, <code>KEY_LOCATION_LEFT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
     * <code>KEY_LOCATION_RIGHT</code>, and <code>KEY_LOCATION_NUMPAD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
     * @see #getKeyLocation()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
    int keyLocation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1057
    //set from native code.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1058
    private transient long rawCode = 0;
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1059
    private transient long primaryLevelUnicode = 0;
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1060
    private transient long scancode = 0; // for MS Windows only
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1061
    private transient long extendedKeyCode = 0;
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1062
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
    private static final long serialVersionUID = -2352130953028126954L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
        /* ensure that the necessary native libraries are loaded */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
        NativeLibLoader.loadLibraries();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
        if (!GraphicsEnvironment.isHeadless()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
            initIDs();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
        }
13604
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1074
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1075
        AWTAccessor.setKeyEventAccessor(
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1076
            new AWTAccessor.KeyEventAccessor() {
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1077
                public void setRawCode(KeyEvent ev, long rawCode) {
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1078
                    ev.rawCode = rawCode;
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1079
                }
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1080
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1081
                public void setPrimaryLevelUnicode(KeyEvent ev,
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1082
                                                   long primaryLevelUnicode) {
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1083
                    ev.primaryLevelUnicode = primaryLevelUnicode;
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1084
                }
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1085
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1086
                public void setExtendedKeyCode(KeyEvent ev,
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1087
                                               long extendedKeyCode) {
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1088
                    ev.extendedKeyCode = extendedKeyCode;
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1089
                }
14310
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1090
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1091
                public Component getOriginalSource( KeyEvent ev ) {
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1092
                    return ev.originalSource;
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1093
                }
13604
31089af1a447 7163201: Simplify toolkit internals references
bagiras
parents: 5506
diff changeset
  1094
            });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     * Initialize JNI field and method IDs for fields that may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
     * accessed from C.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
    private static native void initIDs();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
14310
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1103
    /**
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1104
     * The original event source.
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1105
     *
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1106
     * Event source can be changed during processing, but in some cases
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1107
     * we need to be able to obtain original source.
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1108
     */
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1109
    private Component originalSource;
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1110
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
    private KeyEvent(Component source, int id, long when, int modifiers,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
                    int keyCode, char keyChar, int keyLocation, boolean isProxyActive) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
        this(source, id, when, modifiers, keyCode, keyChar, keyLocation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
        this.isProxyActive = isProxyActive;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
     * Constructs a <code>KeyEvent</code> object.
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1119
     * <p>This method throws an
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
     * <code>IllegalArgumentException</code> if <code>source</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
     *
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1123
     * @param source    The <code>Component</code> that originated the event
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1124
     * @param id              An integer indicating the type of event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1125
     *                  For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1126
     *                  the class description for {@link KeyEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1127
     * @param when      A long integer that specifies the time the event
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1128
     *                  occurred.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1129
     *                     Passing negative or zero value
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1130
     *                     is not recommended
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1131
     * @param modifiers The modifier keys down during event (shift, ctrl,
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1132
     *                  alt, meta).
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1133
     *                     Passing negative value
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1134
     *                     is not recommended.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1135
     *                     Zero value means that no modifiers were passed.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1136
     *                  Use either an extended _DOWN_MASK or old _MASK modifiers,
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1137
     *                  however do not mix models in the one event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1138
     *                  The extended modifiers are preferred for using
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1139
     * @param keyCode   The integer code for an actual key, or VK_UNDEFINED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
     *                  (for a key-typed event)
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1141
     * @param keyChar   The Unicode character generated by this event, or
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
     *                  CHAR_UNDEFINED (for key-pressed and key-released
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
     *                  events which do not map to a valid Unicode character)
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1144
     * @param keyLocation  Identifies the key location.  The only legal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
     *        values are <code>KEY_LOCATION_UNKNOWN</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
     *        <code>KEY_LOCATION_STANDARD</code>, <code>KEY_LOCATION_LEFT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
     *        <code>KEY_LOCATION_RIGHT</code>, and <code>KEY_LOCATION_NUMPAD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
     * @throws IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
     *     if <code>id</code> is <code>KEY_TYPED</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
     *       <code>keyChar</code> is <code>CHAR_UNDEFINED</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
     *     or if <code>id</code> is <code>KEY_TYPED</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
     *       <code>keyCode</code> is not <code>VK_UNDEFINED</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
     *     or if <code>id</code> is <code>KEY_TYPED</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
     *       <code>keyLocation</code> is not <code>KEY_LOCATION_UNKNOWN</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
     *     or if <code>keyLocation</code> is not one of the legal
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
     *       values enumerated above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
     * @throws IllegalArgumentException if <code>source</code> is null
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1158
     * @see #getSource()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1159
     * @see #getID()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1160
     * @see #getWhen()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1161
     * @see #getModifiers()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1162
     * @see #getKeyCode()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1163
     * @see #getKeyChar()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1164
     * @see #getKeyLocation()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
    public KeyEvent(Component source, int id, long when, int modifiers,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
                    int keyCode, char keyChar, int keyLocation) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
        super(source, id, when, modifiers);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
        if (id == KEY_TYPED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
            if (keyChar == CHAR_UNDEFINED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
                throw new IllegalArgumentException("invalid keyChar");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
            if (keyCode != VK_UNDEFINED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
                throw new IllegalArgumentException("invalid keyCode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
            if (keyLocation != KEY_LOCATION_UNKNOWN) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
                throw new IllegalArgumentException("invalid keyLocation");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
        this.keyCode = keyCode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
        this.keyChar = keyChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
        if ((keyLocation < KEY_LOCATION_UNKNOWN) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
            (keyLocation > KEY_LOCATION_NUMPAD)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
            throw new IllegalArgumentException("invalid keyLocation");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
        this.keyLocation = keyLocation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
        if ((getModifiers() != 0) && (getModifiersEx() == 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
            setNewModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
        } else if ((getModifiers() == 0) && (getModifiersEx() != 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
            setOldModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
        }
14310
708173457cc0 8001633: Wrong alt processing during switching between windows.
alexp
parents: 13604
diff changeset
  1195
        originalSource = source;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
     * Constructs a <code>KeyEvent</code> object.
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1200
     * <p> This method throws an
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
     * <code>IllegalArgumentException</code> if <code>source</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
     *
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1204
     * @param source    The <code>Component</code> that originated the event
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1205
     * @param id              An integer indicating the type of event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1206
     *                  For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1207
     *                  the class description for {@link KeyEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1208
     * @param when      A long integer that specifies the time the event
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1209
     *                  occurred.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1210
     *                     Passing negative or zero value
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1211
     *                     is not recommended
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1212
     * @param modifiers The modifier keys down during event (shift, ctrl,
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1213
     *                  alt, meta).
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1214
     *                     Passing negative value
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1215
     *                     is not recommended.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1216
     *                     Zero value means that no modifiers were passed.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1217
     *                  Use either an extended _DOWN_MASK or old _MASK modifiers,
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1218
     *                  however do not mix models in the one event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1219
     *                  The extended modifiers are preferred for using
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1220
     * @param keyCode   The integer code for an actual key, or VK_UNDEFINED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
     *                  (for a key-typed event)
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1222
     * @param keyChar   The Unicode character generated by this event, or
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
     *                  CHAR_UNDEFINED (for key-pressed and key-released
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
     *                  events which do not map to a valid Unicode character)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
     * @throws IllegalArgumentException  if <code>id</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
     *     <code>KEY_TYPED</code> and <code>keyChar</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
     *     <code>CHAR_UNDEFINED</code>; or if <code>id</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
     *     <code>KEY_TYPED</code> and <code>keyCode</code> is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
     *     <code>VK_UNDEFINED</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
     * @throws IllegalArgumentException if <code>source</code> is null
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1231
     * @see #getSource()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1232
     * @see #getID()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1233
     * @see #getWhen()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1234
     * @see #getModifiers()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1235
     * @see #getKeyCode()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
  1236
     * @see #getKeyChar()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
    public KeyEvent(Component source, int id, long when, int modifiers,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
                    int keyCode, char keyChar) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
        this(source, id, when, modifiers, keyCode, keyChar,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
          KEY_LOCATION_UNKNOWN);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
    /**
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1245
     * @deprecated as of JDK1.1; use {@link #KeyEvent(Component, int, long, int, int, char)} instead
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1246
     * @param source    The <code>Component</code> that originated the event
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1247
     * @param id              An integer indicating the type of event.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1248
     *                  For information on allowable values, see
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1249
     *                  the class description for {@link KeyEvent}
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1250
     * @param when      A long integer that specifies the time the event
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1251
     *                  occurred.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1252
     *                     Passing negative or zero value
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1253
     *                     is not recommended
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1254
     * @param modifiers The modifier keys down during event (shift, ctrl,
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1255
     *                  alt, meta).
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1256
     *                     Passing negative value
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1257
     *                     is not recommended.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1258
     *                     Zero value means that no modifiers were passed.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1259
     *                  Use either an extended _DOWN_MASK or old _MASK modifiers,
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1260
     *                  however do not mix models in the one event.
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1261
     *                  The extended modifiers are preferred for using
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1262
     * @param keyCode   The integer code for an actual key, or VK_UNDEFINED
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1263
     *                  (for a key-typed event)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
    public KeyEvent(Component source, int id, long when, int modifiers,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
                    int keyCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
        this(source, id, when, modifiers, keyCode, (char)keyCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
     * Returns the integer keyCode associated with the key in this event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
     * @return the integer code for an actual key on the keyboard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
     *         (For <code>KEY_TYPED</code> events, the keyCode is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
     *         <code>VK_UNDEFINED</code>.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
    public int getKeyCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
        return keyCode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
     * Set the keyCode value to indicate a physical key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
     * @param keyCode an integer corresponding to an actual key on the keyboard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
    public void setKeyCode(int keyCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
        this.keyCode = keyCode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
     * Returns the character associated with the key in this event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
     * For example, the <code>KEY_TYPED</code> event for shift + "a"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
     * returns the value for "A".
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
     * <code>KEY_PRESSED</code> and <code>KEY_RELEASED</code> events
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
     * are not intended for reporting of character input.  Therefore,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
     * the values returned by this method are guaranteed to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
     * meaningful only for <code>KEY_TYPED</code> events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
     * @return the Unicode character defined for this key event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
     *         If no valid Unicode character exists for this key event,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
     *         <code>CHAR_UNDEFINED</code> is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
    public char getKeyChar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
        return keyChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
     * Set the keyChar value to indicate a logical character.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
     *
28059
e576535359cc 8067377: My hobby: caning, then then canning, the the can-can
martin
parents: 26749
diff changeset
  1312
     * @param keyChar a char corresponding to the combination of keystrokes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
     *                that make up this event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
    public void setKeyChar(char keyChar) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
        this.keyChar = keyChar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
     * Set the modifiers to indicate additional keys that were held down
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
     * (e.g. shift, ctrl, alt, meta) defined as part of InputEvent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
     * NOTE:  use of this method is not recommended, because many AWT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
     * implementations do not recognize modifier changes.  This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
     * especially true for <code>KEY_TYPED</code> events where the shift
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
     * modifier is changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
     * @param modifiers an integer combination of the modifier constants.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
     * @see InputEvent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
     * @deprecated as of JDK1.1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
    public void setModifiers(int modifiers) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
        this.modifiers = modifiers;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
        if ((getModifiers() != 0) && (getModifiersEx() == 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
            setNewModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
        } else if ((getModifiers() == 0) && (getModifiersEx() != 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
            setOldModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
     * Returns the location of the key that originated this key event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
     * Some keys occur more than once on a keyboard, e.g. the left and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
     * right shift keys.  Additionally, some keys occur on the numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
     * keypad.  This provides a way of distinguishing such keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
     * @return the location of the key that was pressed or released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
     *         Always returns <code>KEY_LOCATION_UNKNOWN</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
     *         <code>KEY_TYPED</code> events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
    public int getKeyLocation() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
        return keyLocation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
     * Returns a String describing the keyCode, such as "HOME", "F1" or "A".
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
     * These strings can be localized by changing the awt.properties file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
     *
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1362
     * @param keyCode the key whose description is to be returned
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
     * @return a string containing a text description for a physical key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
     *         identified by its keyCode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
    public static String getKeyText(int keyCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
        if (keyCode >= VK_0 && keyCode <= VK_9 ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
            keyCode >= VK_A && keyCode <= VK_Z) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
            return String.valueOf((char)keyCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
        switch(keyCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
          case VK_ENTER: return Toolkit.getProperty("AWT.enter", "Enter");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
          case VK_BACK_SPACE: return Toolkit.getProperty("AWT.backSpace", "Backspace");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
          case VK_TAB: return Toolkit.getProperty("AWT.tab", "Tab");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
          case VK_CANCEL: return Toolkit.getProperty("AWT.cancel", "Cancel");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
          case VK_CLEAR: return Toolkit.getProperty("AWT.clear", "Clear");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
          case VK_COMPOSE: return Toolkit.getProperty("AWT.compose", "Compose");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
          case VK_PAUSE: return Toolkit.getProperty("AWT.pause", "Pause");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
          case VK_CAPS_LOCK: return Toolkit.getProperty("AWT.capsLock", "Caps Lock");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
          case VK_ESCAPE: return Toolkit.getProperty("AWT.escape", "Escape");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
          case VK_SPACE: return Toolkit.getProperty("AWT.space", "Space");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
          case VK_PAGE_UP: return Toolkit.getProperty("AWT.pgup", "Page Up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
          case VK_PAGE_DOWN: return Toolkit.getProperty("AWT.pgdn", "Page Down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
          case VK_END: return Toolkit.getProperty("AWT.end", "End");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
          case VK_HOME: return Toolkit.getProperty("AWT.home", "Home");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
          case VK_LEFT: return Toolkit.getProperty("AWT.left", "Left");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
          case VK_UP: return Toolkit.getProperty("AWT.up", "Up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
          case VK_RIGHT: return Toolkit.getProperty("AWT.right", "Right");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
          case VK_DOWN: return Toolkit.getProperty("AWT.down", "Down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
          case VK_BEGIN: return Toolkit.getProperty("AWT.begin", "Begin");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
          // modifiers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
          case VK_SHIFT: return Toolkit.getProperty("AWT.shift", "Shift");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
          case VK_CONTROL: return Toolkit.getProperty("AWT.control", "Control");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
          case VK_ALT: return Toolkit.getProperty("AWT.alt", "Alt");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
          case VK_META: return Toolkit.getProperty("AWT.meta", "Meta");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
          case VK_ALT_GRAPH: return Toolkit.getProperty("AWT.altGraph", "Alt Graph");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
          // punctuation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
          case VK_COMMA: return Toolkit.getProperty("AWT.comma", "Comma");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
          case VK_PERIOD: return Toolkit.getProperty("AWT.period", "Period");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
          case VK_SLASH: return Toolkit.getProperty("AWT.slash", "Slash");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
          case VK_SEMICOLON: return Toolkit.getProperty("AWT.semicolon", "Semicolon");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
          case VK_EQUALS: return Toolkit.getProperty("AWT.equals", "Equals");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
          case VK_OPEN_BRACKET: return Toolkit.getProperty("AWT.openBracket", "Open Bracket");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
          case VK_BACK_SLASH: return Toolkit.getProperty("AWT.backSlash", "Back Slash");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
          case VK_CLOSE_BRACKET: return Toolkit.getProperty("AWT.closeBracket", "Close Bracket");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
          // numpad numeric keys handled below
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
          case VK_MULTIPLY: return Toolkit.getProperty("AWT.multiply", "NumPad *");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
          case VK_ADD: return Toolkit.getProperty("AWT.add", "NumPad +");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
          case VK_SEPARATOR: return Toolkit.getProperty("AWT.separator", "NumPad ,");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
          case VK_SUBTRACT: return Toolkit.getProperty("AWT.subtract", "NumPad -");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
          case VK_DECIMAL: return Toolkit.getProperty("AWT.decimal", "NumPad .");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
          case VK_DIVIDE: return Toolkit.getProperty("AWT.divide", "NumPad /");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
          case VK_DELETE: return Toolkit.getProperty("AWT.delete", "Delete");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
          case VK_NUM_LOCK: return Toolkit.getProperty("AWT.numLock", "Num Lock");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
          case VK_SCROLL_LOCK: return Toolkit.getProperty("AWT.scrollLock", "Scroll Lock");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
          case VK_WINDOWS: return Toolkit.getProperty("AWT.windows", "Windows");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
          case VK_CONTEXT_MENU: return Toolkit.getProperty("AWT.context", "Context Menu");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
          case VK_F1: return Toolkit.getProperty("AWT.f1", "F1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
          case VK_F2: return Toolkit.getProperty("AWT.f2", "F2");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
          case VK_F3: return Toolkit.getProperty("AWT.f3", "F3");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
          case VK_F4: return Toolkit.getProperty("AWT.f4", "F4");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
          case VK_F5: return Toolkit.getProperty("AWT.f5", "F5");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
          case VK_F6: return Toolkit.getProperty("AWT.f6", "F6");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
          case VK_F7: return Toolkit.getProperty("AWT.f7", "F7");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
          case VK_F8: return Toolkit.getProperty("AWT.f8", "F8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
          case VK_F9: return Toolkit.getProperty("AWT.f9", "F9");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
          case VK_F10: return Toolkit.getProperty("AWT.f10", "F10");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
          case VK_F11: return Toolkit.getProperty("AWT.f11", "F11");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
          case VK_F12: return Toolkit.getProperty("AWT.f12", "F12");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
          case VK_F13: return Toolkit.getProperty("AWT.f13", "F13");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
          case VK_F14: return Toolkit.getProperty("AWT.f14", "F14");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
          case VK_F15: return Toolkit.getProperty("AWT.f15", "F15");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
          case VK_F16: return Toolkit.getProperty("AWT.f16", "F16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
          case VK_F17: return Toolkit.getProperty("AWT.f17", "F17");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
          case VK_F18: return Toolkit.getProperty("AWT.f18", "F18");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
          case VK_F19: return Toolkit.getProperty("AWT.f19", "F19");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
          case VK_F20: return Toolkit.getProperty("AWT.f20", "F20");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
          case VK_F21: return Toolkit.getProperty("AWT.f21", "F21");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
          case VK_F22: return Toolkit.getProperty("AWT.f22", "F22");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
          case VK_F23: return Toolkit.getProperty("AWT.f23", "F23");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
          case VK_F24: return Toolkit.getProperty("AWT.f24", "F24");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
          case VK_PRINTSCREEN: return Toolkit.getProperty("AWT.printScreen", "Print Screen");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
          case VK_INSERT: return Toolkit.getProperty("AWT.insert", "Insert");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
          case VK_HELP: return Toolkit.getProperty("AWT.help", "Help");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
          case VK_BACK_QUOTE: return Toolkit.getProperty("AWT.backQuote", "Back Quote");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
          case VK_QUOTE: return Toolkit.getProperty("AWT.quote", "Quote");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
          case VK_KP_UP: return Toolkit.getProperty("AWT.up", "Up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
          case VK_KP_DOWN: return Toolkit.getProperty("AWT.down", "Down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
          case VK_KP_LEFT: return Toolkit.getProperty("AWT.left", "Left");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
          case VK_KP_RIGHT: return Toolkit.getProperty("AWT.right", "Right");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
          case VK_DEAD_GRAVE: return Toolkit.getProperty("AWT.deadGrave", "Dead Grave");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
          case VK_DEAD_ACUTE: return Toolkit.getProperty("AWT.deadAcute", "Dead Acute");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
          case VK_DEAD_CIRCUMFLEX: return Toolkit.getProperty("AWT.deadCircumflex", "Dead Circumflex");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
          case VK_DEAD_TILDE: return Toolkit.getProperty("AWT.deadTilde", "Dead Tilde");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
          case VK_DEAD_MACRON: return Toolkit.getProperty("AWT.deadMacron", "Dead Macron");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
          case VK_DEAD_BREVE: return Toolkit.getProperty("AWT.deadBreve", "Dead Breve");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
          case VK_DEAD_ABOVEDOT: return Toolkit.getProperty("AWT.deadAboveDot", "Dead Above Dot");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
          case VK_DEAD_DIAERESIS: return Toolkit.getProperty("AWT.deadDiaeresis", "Dead Diaeresis");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
          case VK_DEAD_ABOVERING: return Toolkit.getProperty("AWT.deadAboveRing", "Dead Above Ring");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
          case VK_DEAD_DOUBLEACUTE: return Toolkit.getProperty("AWT.deadDoubleAcute", "Dead Double Acute");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
          case VK_DEAD_CARON: return Toolkit.getProperty("AWT.deadCaron", "Dead Caron");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
          case VK_DEAD_CEDILLA: return Toolkit.getProperty("AWT.deadCedilla", "Dead Cedilla");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
          case VK_DEAD_OGONEK: return Toolkit.getProperty("AWT.deadOgonek", "Dead Ogonek");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
          case VK_DEAD_IOTA: return Toolkit.getProperty("AWT.deadIota", "Dead Iota");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
          case VK_DEAD_VOICED_SOUND: return Toolkit.getProperty("AWT.deadVoicedSound", "Dead Voiced Sound");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
          case VK_DEAD_SEMIVOICED_SOUND: return Toolkit.getProperty("AWT.deadSemivoicedSound", "Dead Semivoiced Sound");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
          case VK_AMPERSAND: return Toolkit.getProperty("AWT.ampersand", "Ampersand");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
          case VK_ASTERISK: return Toolkit.getProperty("AWT.asterisk", "Asterisk");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
          case VK_QUOTEDBL: return Toolkit.getProperty("AWT.quoteDbl", "Double Quote");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
          case VK_LESS: return Toolkit.getProperty("AWT.Less", "Less");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
          case VK_GREATER: return Toolkit.getProperty("AWT.greater", "Greater");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
          case VK_BRACELEFT: return Toolkit.getProperty("AWT.braceLeft", "Left Brace");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
          case VK_BRACERIGHT: return Toolkit.getProperty("AWT.braceRight", "Right Brace");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
          case VK_AT: return Toolkit.getProperty("AWT.at", "At");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
          case VK_COLON: return Toolkit.getProperty("AWT.colon", "Colon");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
          case VK_CIRCUMFLEX: return Toolkit.getProperty("AWT.circumflex", "Circumflex");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
          case VK_DOLLAR: return Toolkit.getProperty("AWT.dollar", "Dollar");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
          case VK_EURO_SIGN: return Toolkit.getProperty("AWT.euro", "Euro");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
          case VK_EXCLAMATION_MARK: return Toolkit.getProperty("AWT.exclamationMark", "Exclamation Mark");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
          case VK_INVERTED_EXCLAMATION_MARK: return Toolkit.getProperty("AWT.invertedExclamationMark", "Inverted Exclamation Mark");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
          case VK_LEFT_PARENTHESIS: return Toolkit.getProperty("AWT.leftParenthesis", "Left Parenthesis");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
          case VK_NUMBER_SIGN: return Toolkit.getProperty("AWT.numberSign", "Number Sign");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
          case VK_MINUS: return Toolkit.getProperty("AWT.minus", "Minus");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
          case VK_PLUS: return Toolkit.getProperty("AWT.plus", "Plus");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
          case VK_RIGHT_PARENTHESIS: return Toolkit.getProperty("AWT.rightParenthesis", "Right Parenthesis");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
          case VK_UNDERSCORE: return Toolkit.getProperty("AWT.underscore", "Underscore");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
          case VK_FINAL: return Toolkit.getProperty("AWT.final", "Final");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
          case VK_CONVERT: return Toolkit.getProperty("AWT.convert", "Convert");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
          case VK_NONCONVERT: return Toolkit.getProperty("AWT.noconvert", "No Convert");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
          case VK_ACCEPT: return Toolkit.getProperty("AWT.accept", "Accept");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
          case VK_MODECHANGE: return Toolkit.getProperty("AWT.modechange", "Mode Change");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
          case VK_KANA: return Toolkit.getProperty("AWT.kana", "Kana");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
          case VK_KANJI: return Toolkit.getProperty("AWT.kanji", "Kanji");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
          case VK_ALPHANUMERIC: return Toolkit.getProperty("AWT.alphanumeric", "Alphanumeric");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
          case VK_KATAKANA: return Toolkit.getProperty("AWT.katakana", "Katakana");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
          case VK_HIRAGANA: return Toolkit.getProperty("AWT.hiragana", "Hiragana");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
          case VK_FULL_WIDTH: return Toolkit.getProperty("AWT.fullWidth", "Full-Width");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
          case VK_HALF_WIDTH: return Toolkit.getProperty("AWT.halfWidth", "Half-Width");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
          case VK_ROMAN_CHARACTERS: return Toolkit.getProperty("AWT.romanCharacters", "Roman Characters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
          case VK_ALL_CANDIDATES: return Toolkit.getProperty("AWT.allCandidates", "All Candidates");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
          case VK_PREVIOUS_CANDIDATE: return Toolkit.getProperty("AWT.previousCandidate", "Previous Candidate");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
          case VK_CODE_INPUT: return Toolkit.getProperty("AWT.codeInput", "Code Input");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
          case VK_JAPANESE_KATAKANA: return Toolkit.getProperty("AWT.japaneseKatakana", "Japanese Katakana");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
          case VK_JAPANESE_HIRAGANA: return Toolkit.getProperty("AWT.japaneseHiragana", "Japanese Hiragana");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
          case VK_JAPANESE_ROMAN: return Toolkit.getProperty("AWT.japaneseRoman", "Japanese Roman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
          case VK_KANA_LOCK: return Toolkit.getProperty("AWT.kanaLock", "Kana Lock");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
          case VK_INPUT_METHOD_ON_OFF: return Toolkit.getProperty("AWT.inputMethodOnOff", "Input Method On/Off");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
          case VK_AGAIN: return Toolkit.getProperty("AWT.again", "Again");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
          case VK_UNDO: return Toolkit.getProperty("AWT.undo", "Undo");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
          case VK_COPY: return Toolkit.getProperty("AWT.copy", "Copy");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
          case VK_PASTE: return Toolkit.getProperty("AWT.paste", "Paste");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
          case VK_CUT: return Toolkit.getProperty("AWT.cut", "Cut");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
          case VK_FIND: return Toolkit.getProperty("AWT.find", "Find");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
          case VK_PROPS: return Toolkit.getProperty("AWT.props", "Props");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
          case VK_STOP: return Toolkit.getProperty("AWT.stop", "Stop");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
        if (keyCode >= VK_NUMPAD0 && keyCode <= VK_NUMPAD9) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
            String numpad = Toolkit.getProperty("AWT.numpad", "NumPad");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
            char c = (char)(keyCode - VK_NUMPAD0 + '0');
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
            return numpad + "-" + c;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1536
        if ((keyCode & 0x01000000) != 0) {
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1537
            return String.valueOf((char)(keyCode ^ 0x01000000 ));
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1538
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
        String unknown = Toolkit.getProperty("AWT.unknown", "Unknown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
        return unknown + " keyCode: 0x" + Integer.toString(keyCode, 16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
     * Returns a <code>String</code> describing the modifier key(s),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
     * such as "Shift", or "Ctrl+Shift".  These strings can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
     * localized by changing the <code>awt.properties</code> file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
     * Note that <code>InputEvent.ALT_MASK</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
     * <code>InputEvent.BUTTON2_MASK</code> have the same value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
     * so the string "Alt" is returned for both modifiers.  Likewise,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
     * <code>InputEvent.META_MASK</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
     * <code>InputEvent.BUTTON3_MASK</code> have the same value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
     * so the string "Meta" is returned for both modifiers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
     *
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1555
     * @param modifiers the modifier mask to be processed
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
     * @return string a text description of the combination of modifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
     *                keys that were held down during the event
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
     * @see InputEvent#getModifiersExText(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
    public static String getKeyModifiersText(int modifiers) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
        StringBuilder buf = new StringBuilder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
        if ((modifiers & InputEvent.META_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
            buf.append(Toolkit.getProperty("AWT.meta", "Meta"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
        if ((modifiers & InputEvent.CTRL_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
            buf.append(Toolkit.getProperty("AWT.control", "Ctrl"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
        if ((modifiers & InputEvent.ALT_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
            buf.append(Toolkit.getProperty("AWT.alt", "Alt"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
        if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
            buf.append(Toolkit.getProperty("AWT.shift", "Shift"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
        if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
            buf.append(Toolkit.getProperty("AWT.altGraph", "Alt Graph"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
        if ((modifiers & InputEvent.BUTTON1_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
            buf.append(Toolkit.getProperty("AWT.button1", "Button1"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
            buf.append("+");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
        if (buf.length() > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
            buf.setLength(buf.length()-1); // remove trailing '+'
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
        return buf.toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
     * Returns whether the key in this event is an "action" key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
     * Typically an action key does not fire a unicode character and is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
     * not a modifier key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
     * @return <code>true</code> if the key is an "action" key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
     *         <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
    public boolean isActionKey() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
        switch (keyCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
          case VK_HOME:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
          case VK_END:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
          case VK_PAGE_UP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
          case VK_PAGE_DOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
          case VK_UP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
          case VK_DOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
          case VK_LEFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
          case VK_RIGHT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
          case VK_BEGIN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
          case VK_KP_LEFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
          case VK_KP_UP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
          case VK_KP_RIGHT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
          case VK_KP_DOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
          case VK_F1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
          case VK_F2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
          case VK_F3:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
          case VK_F4:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
          case VK_F5:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
          case VK_F6:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
          case VK_F7:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
          case VK_F8:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
          case VK_F9:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
          case VK_F10:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
          case VK_F11:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
          case VK_F12:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
          case VK_F13:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
          case VK_F14:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
          case VK_F15:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
          case VK_F16:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
          case VK_F17:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
          case VK_F18:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
          case VK_F19:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
          case VK_F20:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
          case VK_F21:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
          case VK_F22:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
          case VK_F23:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
          case VK_F24:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
          case VK_PRINTSCREEN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
          case VK_SCROLL_LOCK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
          case VK_CAPS_LOCK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
          case VK_NUM_LOCK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
          case VK_PAUSE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
          case VK_INSERT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
          case VK_FINAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
          case VK_CONVERT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
          case VK_NONCONVERT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
          case VK_ACCEPT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
          case VK_MODECHANGE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
          case VK_KANA:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
          case VK_KANJI:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
          case VK_ALPHANUMERIC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
          case VK_KATAKANA:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
          case VK_HIRAGANA:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
          case VK_FULL_WIDTH:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
          case VK_HALF_WIDTH:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
          case VK_ROMAN_CHARACTERS:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
          case VK_ALL_CANDIDATES:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
          case VK_PREVIOUS_CANDIDATE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
          case VK_CODE_INPUT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
          case VK_JAPANESE_KATAKANA:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
          case VK_JAPANESE_HIRAGANA:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
          case VK_JAPANESE_ROMAN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
          case VK_KANA_LOCK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
          case VK_INPUT_METHOD_ON_OFF:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
          case VK_AGAIN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
          case VK_UNDO:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
          case VK_COPY:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
          case VK_PASTE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
          case VK_CUT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
          case VK_FIND:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
          case VK_PROPS:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
          case VK_STOP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
          case VK_HELP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
          case VK_WINDOWS:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
          case VK_CONTEXT_MENU:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
              return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
     * Returns a parameter string identifying this event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
     * This method is useful for event logging and for debugging.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
     * @return a string identifying the event and its attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
    public String paramString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
        StringBuilder str = new StringBuilder(100);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
        switch (id) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
          case KEY_PRESSED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
            str.append("KEY_PRESSED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
          case KEY_RELEASED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
            str.append("KEY_RELEASED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
          case KEY_TYPED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
            str.append("KEY_TYPED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
          default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
            str.append("unknown type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
        str.append(",keyCode=").append(keyCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
        str.append(",keyText=").append(getKeyText(keyCode));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
        /* Some keychars don't print well, e.g. escape, backspace,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
         * tab, return, delete, cancel.  Get keyText for the keyCode
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
         * instead of the keyChar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
        str.append(",keyChar=");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
        switch (keyChar) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
          case '\b':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
            str.append(getKeyText(VK_BACK_SPACE));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
          case '\t':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
            str.append(getKeyText(VK_TAB));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
          case '\n':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
            str.append(getKeyText(VK_ENTER));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
          case '\u0018':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
            str.append(getKeyText(VK_CANCEL));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
          case '\u001b':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
            str.append(getKeyText(VK_ESCAPE));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
          case '\u007f':
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
            str.append(getKeyText(VK_DELETE));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
          case CHAR_UNDEFINED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
            str.append(Toolkit.getProperty("AWT.undefined", "Undefined"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
            str.append(" keyChar");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
          default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
            str.append("'").append(keyChar).append("'");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
        if (getModifiers() != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
            str.append(",modifiers=").append(getKeyModifiersText(modifiers));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
        if (getModifiersEx() != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
            str.append(",extModifiers=").append(getModifiersExText(modifiers));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
        str.append(",keyLocation=");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
        switch (keyLocation) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
          case KEY_LOCATION_UNKNOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
            str.append("KEY_LOCATION_UNKNOWN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
          case KEY_LOCATION_STANDARD:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
            str.append("KEY_LOCATION_STANDARD");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1762
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
          case KEY_LOCATION_LEFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
            str.append("KEY_LOCATION_LEFT");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
          case KEY_LOCATION_RIGHT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
            str.append("KEY_LOCATION_RIGHT");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
          case KEY_LOCATION_NUMPAD:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
            str.append("KEY_LOCATION_NUMPAD");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1772
          default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
            str.append("KEY_LOCATION_UNKNOWN");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1774
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1775
        }
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1776
        str.append(",rawCode=").append(rawCode);
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1777
        str.append(",primaryLevelUnicode=").append(primaryLevelUnicode);
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1778
        str.append(",scancode=").append(scancode);
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1779
        str.append(",extendedKeyCode=0x").append(Long.toHexString(extendedKeyCode));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1780
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1781
        return str.toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1782
    }
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1783
    /**
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1784
     * Returns an extended key code for the event.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1785
     * The extended key code is a unique id assigned to  a key on the keyboard
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1786
     * just like {@code keyCode}. However, unlike {@code keyCode}, this value depends on the
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1787
     * current keyboard layout. For instance, pressing the left topmost letter key
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1788
     * in a common English layout produces the same value as {@code keyCode}, {@code VK_Q}.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1789
     * Pressing the same key in a regular Russian layout gives another code, unique for the
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1790
     * letter "Cyrillic I short".
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1791
     *
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1792
     * @return an extended key code for the event
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1793
     * @since 1.7
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1794
     */
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1795
    public  int getExtendedKeyCode() {
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1796
        return (int)extendedKeyCode;
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1797
    }
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1798
    /**
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1799
     * Returns an extended key code for a unicode character.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1800
     *
22254
8550495a4d78 8030845: Fix doclint missing issues in java.awt.event
darcy
parents: 21278
diff changeset
  1801
     * @param c the unicode character to be processed
2473
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1802
     * @return for a unicode character with a corresponding {@code VK_} constant -- this
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1803
     *   {@code VK_} constant; for a character appearing on the primary
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1804
     *   level of a known keyboard layout -- a unique integer.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1805
     *   If a character does not appear on the primary level of a known keyboard,
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1806
     *   {@code VK_UNDEFINED} is returned.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1807
     *
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1808
     * @since 1.7
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1809
     */
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1810
    public static int getExtendedKeyCodeForChar(int c) {
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1811
        // Return a keycode (if any) associated with a character.
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1812
        return sun.awt.ExtendedKeyCodes.getExtendedKeyCodeForChar(c);
3f4bbd3be2f1 6680988: KeyEvent is still missing VK values for many keyboards
yan
parents: 440
diff changeset
  1813
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
     * Sets new modifiers by the old ones. The key modifiers
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
  1817
     * override overlapping mouse modifiers.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
    private void setNewModifiers() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
        if ((modifiers & SHIFT_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1821
            modifiers |= SHIFT_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
        if ((modifiers & ALT_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
            modifiers |= ALT_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1826
        if ((modifiers & CTRL_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
            modifiers |= CTRL_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
        if ((modifiers & META_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
            modifiers |= META_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
        if ((modifiers & ALT_GRAPH_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
            modifiers |= ALT_GRAPH_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
        if ((modifiers & BUTTON1_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
            modifiers |= BUTTON1_DOWN_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
     * Sets old modifiers by the new ones.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1843
    private void setOldModifiers() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1844
        if ((modifiers & SHIFT_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
            modifiers |= SHIFT_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
        if ((modifiers & ALT_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
            modifiers |= ALT_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1849
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1850
        if ((modifiers & CTRL_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1851
            modifiers |= CTRL_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1852
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1853
        if ((modifiers & META_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1854
            modifiers |= META_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1855
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1856
        if ((modifiers & ALT_GRAPH_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1857
            modifiers |= ALT_GRAPH_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1858
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1859
        if ((modifiers & BUTTON1_DOWN_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
            modifiers |= BUTTON1_MASK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1863
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
     * Sets new modifiers by the old ones. The key modifiers
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
  1866
     * override overlapping mouse modifiers.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
    private void readObject(ObjectInputStream s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
      throws IOException, ClassNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1871
        s.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
        if (getModifiers() != 0 && getModifiersEx() == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
            setNewModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1875
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
}