15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.BorderLayout;
25 import java.awt.Canvas;
26 import java.awt.EventQueue;
27 import java.awt.Frame;
28 import java.awt.event.FocusAdapter;
29 import java.awt.event.FocusEvent;
30 import java.awt.event.InputEvent;
31 import java.awt.event.KeyAdapter;
32 import java.awt.event.KeyEvent;
33 import java.awt.event.MouseEvent;
34
35 import static jdk.testlibrary.Asserts.assertTrue;
36
37 /*
38 * NOTE: this is no intentionally a manual test (i.e. has no test tag) because
39 * even on Windows, the various tested key-combination may get partially
40 * intercepted by other applications and this can leave the whole system in an
41 * inconsistent state. For example on my Windows machine with Intel Graphics
42 * the key combinations "Ctl-Alt-F11" and "Ctl-Alt-F12" triggers some Intel
43 * Graphics utilities by default. If the test is run in such an environment,
44 * some key events of the test are intercepted by those utilities with the
45 * result that the test fails and no more keyboard input will be possible at
46 * all.
47 *
48 * To execute the test add a '@' before the 'test' keyword below to make it a tag.
49 */
50
51 /*
52 * test 8155742
53 *
54 * @summary Make sure that modifier key mask is set when robot press
55 * some key with one or more modifiers.
56 * @library ../../../../lib/testlibrary/
57 * @build ExtendedRobot
58 * @key headful
59 * @run main/timeout=600 ModifierRobotEnhancedKeyTest
60 */
61
62 public class ModifierRobotEnhancedKeyTest extends KeyAdapter {
63
64 private boolean focusGained = false;
65 private boolean startTest = false;
66 private ExtendedRobot robot;
67 private Frame frame;
68 private Canvas canvas;
69
70 private volatile boolean tempPress = false;
71
72 private int[] textKeys, modifierKeys, inputMasks;
73 private boolean[] modifierStatus, textStatus;
74
75 private final static int waitDelay = 5000;
76 private Object tempLock = new Object();
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.BorderLayout;
25 import java.awt.Canvas;
26 import java.awt.EventQueue;
27 import java.awt.Frame;
28 import java.awt.event.FocusAdapter;
29 import java.awt.event.FocusEvent;
30 import java.awt.event.InputEvent;
31 import java.awt.event.KeyAdapter;
32 import java.awt.event.KeyEvent;
33 import java.awt.event.MouseEvent;
34
35 import static jdk.test.lib.Asserts.assertTrue;
36
37 /*
38 * NOTE: this is no intentionally a manual test (i.e. has no test tag) because
39 * even on Windows, the various tested key-combination may get partially
40 * intercepted by other applications and this can leave the whole system in an
41 * inconsistent state. For example on my Windows machine with Intel Graphics
42 * the key combinations "Ctl-Alt-F11" and "Ctl-Alt-F12" triggers some Intel
43 * Graphics utilities by default. If the test is run in such an environment,
44 * some key events of the test are intercepted by those utilities with the
45 * result that the test fails and no more keyboard input will be possible at
46 * all.
47 *
48 * To execute the test add a '@' before the 'test' keyword below to make it a tag.
49 */
50
51 /*
52 * test 8155742
53 *
54 * @summary Make sure that modifier key mask is set when robot press
55 * some key with one or more modifiers.
56 * @library /lib/testlibrary/
57 * @library /test/lib
58 * @build ExtendedRobot
59 * @key headful
60 * @run main/timeout=600 ModifierRobotEnhancedKeyTest
61 */
62
63 public class ModifierRobotEnhancedKeyTest extends KeyAdapter {
64
65 private boolean focusGained = false;
66 private boolean startTest = false;
67 private ExtendedRobot robot;
68 private Frame frame;
69 private Canvas canvas;
70
71 private volatile boolean tempPress = false;
72
73 private int[] textKeys, modifierKeys, inputMasks;
74 private boolean[] modifierStatus, textStatus;
75
76 private final static int waitDelay = 5000;
77 private Object tempLock = new Object();
|