From: Matti Tahvonen Date: Tue, 5 Aug 2008 11:19:33 +0000 (+0000) Subject: cancels events with found key combinations. allows using key combos like "ctrl-s" X-Git-Tag: 6.7.0.beta1~4401 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7ca7bdf8696bebdab8555213f9c72652e27e3128;p=vaadin-framework.git cancels events with found key combinations. allows using key combos like "ctrl-s" svn changeset:5139/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ShortcutActionHandler.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ShortcutActionHandler.java index 244710c6c9..ec14f95aaf 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ShortcutActionHandler.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ShortcutActionHandler.java @@ -66,7 +66,7 @@ public class ShortcutActionHandler { } } - public void handleKeyboardEvent(Event event) { + public void handleKeyboardEvent(final Event event) { final int modifiers = KeyboardListenerCollection .getKeyboardModifiers(event); final char keyCode = (char) DOM.eventGetKeyCode(event); @@ -76,6 +76,7 @@ public class ShortcutActionHandler { while (it.hasNext()) { final ShortcutAction a = (ShortcutAction) it.next(); if (a.getShortcutCombination().equals(kc)) { + DOM.eventPreventDefault(event); shakeTarget(DOM.eventGetTarget(event)); DeferredCommand.addCommand(new Command() { public void execute() {