/** * Gets the native key code. These key codes are enumerated in the * {@link KeyCodes} class. * * @return the key code */ public int getNativeKeyCode() { return getNativeEvent().getKeyCode(); }
/** * Is this a key down arrow? * * @return whether this is a down arrow key event */ public boolean isDownArrow() { return getNativeKeyCode() == KeyCodes.KEY_DOWN; }
protected void preventEvent(KeyCodeEvent event) { event.preventDefault(); event.stopPropagation(); }
/** * Is this a left arrow? * * @return whether this is a left arrow key event */ public boolean isLeftArrow() { return getNativeKeyCode() == KeyCodes.KEY_LEFT; }
/** * Gets the native key code. These key codes are enumerated in the * {@link KeyCodes} class. * * @return the key code */ public int getNativeKeyCode() { return getNativeEvent().getKeyCode(); }
/** * Is this a up arrow? * * @return whether this is a right arrow key event */ public boolean isUpArrow() { return getNativeKeyCode() == KeyCodes.KEY_UP; }
/** * Gets the native key code. These key codes are enumerated in the * {@link KeyCodes} class. * * @return the key code */ public int getNativeKeyCode() { return getNativeEvent().getKeyCode(); }
/** * Is this a right arrow? * * @return whether this is a right arrow key event */ public boolean isRightArrow() { return getNativeKeyCode() == KeyCodes.KEY_RIGHT; }
@Override public void onKeyCodeEvent(final KeyCodeEvent<?> event, final String searchText) { final int keyCode = event.getNativeEvent().getKeyCode(); final boolean isKeyUp = event instanceof KeyUpEvent; final boolean isKeyDown = event instanceof KeyDownEvent;
@Override public String toDebugString() { return super.toDebugString() + "[" + getNativeKeyCode() + "]"; } }
/** * Is this a left arrow? * * @return whether this is a left arrow key event */ public boolean isLeftArrow() { return getNativeKeyCode() == KeyCodes.KEY_LEFT; }
/** * Is this a up arrow? * * @return whether this is a right arrow key event */ public boolean isUpArrow() { return getNativeKeyCode() == KeyCodes.KEY_UP; }
/** * Is this a key down arrow? * * @return whether this is a down arrow key event */ public boolean isDownArrow() { return getNativeKeyCode() == KeyCodes.KEY_DOWN; }
/** * Is this a key down arrow? * * @return whether this is a down arrow key event */ public boolean isDownArrow() { return getNativeKeyCode() == KeyCodes.KEY_DOWN; }
/** * Is this a left arrow? * * @return whether this is a left arrow key event */ public boolean isLeftArrow() { return getNativeKeyCode() == KeyCodes.KEY_LEFT; }
/** * Is this a right arrow? * * @return whether this is a right arrow key event */ public boolean isRightArrow() { return getNativeKeyCode() == KeyCodes.KEY_RIGHT; }
/** * Is this a right arrow? * * @return whether this is a right arrow key event */ public boolean isRightArrow() { return getNativeKeyCode() == KeyCodes.KEY_RIGHT; }
/** * Is this a up arrow? * * @return whether this is a right arrow key event */ public boolean isUpArrow() { return getNativeKeyCode() == KeyCodes.KEY_UP; }
@Override public String toDebugString() { return super.toDebugString() + "[" + getNativeKeyCode() + "]"; } }
@Override public String toDebugString() { return super.toDebugString() + "[" + getNativeKeyCode() + "]"; } }