Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
use Keys object in KeyShortcutEvent instead of separate parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason authored and alex-sl-eng committed Aug 2, 2012
1 parent b4cc050 commit 3316172
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Expand Up @@ -20,6 +20,8 @@
*/
package org.zanata.webtrans.client.events;

import org.zanata.webtrans.client.keys.Keys;

import com.google.gwt.event.shared.GwtEvent;

/**
Expand All @@ -28,24 +30,16 @@
*/
public class KeyShortcutEvent extends GwtEvent<KeyShortcutEventHandler>
{
private final Keys keys;

private final int modifiers;
private final int keyCode;

public int getModifiers()
{
return modifiers;
}

public int getKeyCode()
public Keys getKeys()
{
return keyCode;
return keys;
}

public KeyShortcutEvent(int modifiers, int keyCode)
public KeyShortcutEvent(Keys keys)
{
this.modifiers = modifiers;
this.keyCode = keyCode;
this.keys = keys;
}

@Override
Expand Down
Expand Up @@ -234,7 +234,7 @@ private void processKeyEvent(NativeEvent evt)
Set<KeyShortcut> shortcuts = ensureShortcutMap().get(pressedKeys);
boolean shortcutFound = false;
// TODO replace modifiers + keycode in event with Keys
KeyShortcutEvent shortcutEvent = new KeyShortcutEvent(pressedKeys.getModifiers(), pressedKeys.getKeyCode());
KeyShortcutEvent shortcutEvent = new KeyShortcutEvent(pressedKeys);
if (shortcuts != null && !shortcuts.isEmpty())
{
for (KeyShortcut shortcut : shortcuts)
Expand Down

0 comments on commit 3316172

Please sign in to comment.