14 *
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.Frame;
25 import java.awt.Robot;
26 import java.awt.Toolkit;
27 import java.awt.event.KeyEvent;
28 import java.awt.event.KeyAdapter;
29 import sun.awt.ExtendedKeyCodes;
30 import sun.awt.SunToolkit;
31
32 /*
33 * @test
34 * @bug 8007156 8025126
35 * @summary Extended key code is not set for a key event
36 * @author Alexandr Scherbatiy
37 * @run main ExtendedKeyCodeTest
38 */
39 public class ExtendedKeyCodeTest {
40
41 private static volatile boolean setExtendedKeyCode = true;
42 private static volatile int eventsCount = 0;
43
44 public static void main(String[] args) throws Exception {
45 SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
46 Robot robot = new Robot();
47 robot.setAutoDelay(50);
48
49 Frame frame = new Frame();
50 frame.setSize(300, 300);
51
52 frame.addKeyListener(new KeyAdapter() {
53
|
14 *
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.Frame;
25 import java.awt.Robot;
26 import java.awt.Toolkit;
27 import java.awt.event.KeyEvent;
28 import java.awt.event.KeyAdapter;
29 import sun.awt.ExtendedKeyCodes;
30 import sun.awt.SunToolkit;
31
32 /*
33 * @test
34 * @key headful
35 * @bug 8007156 8025126
36 * @summary Extended key code is not set for a key event
37 * @author Alexandr Scherbatiy
38 * @run main ExtendedKeyCodeTest
39 */
40 public class ExtendedKeyCodeTest {
41
42 private static volatile boolean setExtendedKeyCode = true;
43 private static volatile int eventsCount = 0;
44
45 public static void main(String[] args) throws Exception {
46 SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
47 Robot robot = new Robot();
48 robot.setAutoDelay(50);
49
50 Frame frame = new Frame();
51 frame.setSize(300, 300);
52
53 frame.addKeyListener(new KeyAdapter() {
54
|