summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket5157.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket5157.java')
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket5157.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5157.java b/uitest/src/com/vaadin/tests/tickets/Ticket5157.java
new file mode 100644
index 0000000000..3102a0a56c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket5157.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.event.ShortcutAction.KeyCode;
+import com.vaadin.event.ShortcutListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+/**
+ * Key codes were converted to lower case on the server (overlapping special key
+ * codes for function keys etc.) and then back to upper case on the client.
+ * Therefore, registering e.g. F8 as a key code resulted in "w" being used as
+ * the trigger and F8 being ignored.
+ */
+public class Ticket5157 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
+ setMainWindow(mainWindow);
+
+ Panel p = new Panel();
+ mainWindow.addComponent(p);
+
+ Label l = new Label("Panel with F8 bound");
+ p.addComponent(l);
+
+ TextField f = new TextField();
+ p.addComponent(f);
+
+ p.addAction(new ShortcutListener("F8", KeyCode.F8, null) {
+
+ @Override
+ public void handleAction(Object sender, Object target) {
+ mainWindow.showNotification(getCaption());
+
+ }
+ });
+
+ p.addAction(new ShortcutListener("a", KeyCode.A, null) {
+
+ @Override
+ public void handleAction(Object sender, Object target) {
+ mainWindow.showNotification(getCaption());
+
+ }
+ });
+ }
+
+}