Package com.google.gwt.event.dom.client

Examples of com.google.gwt.event.dom.client.KeyDownHandler


  /**
   * Initializes the controls of the example.
   */
  private void initControls() {
    // Handle keyboard input
    webGLCanvas.addKeyDownHandler(new KeyDownHandler() {
      @Override
      public void onKeyDown(KeyDownEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_PAGEUP) {
          translateZ += 0.1f;
          event.stopPropagation();
View Full Code Here


        double scaleFactor = photo.getScaleFactor(Window.getClientWidth(),
                Window.getClientHeight());
        final int width = (int) (photo.getWidth() * scaleFactor);
        Image image = new Image(photo.getURL(width));
        FocusPanel focusPanel = new FocusPanel(image);
        focusPanel.addKeyDownHandler(new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent event) {
                switch (event.getNativeKeyCode()) {
                case KeyCodes.KEY_RIGHT:
                    showNearbyPhoto(true);
                    break;
View Full Code Here

    final TextBox incre = new TextBox();
    incre.setText("2");
    randomOrEqual = new CheckBox(
        "random if checked/ otherwise equally spaced");

    angleBox.addKeyDownHandler(new KeyDownHandler() {

      public void onKeyDown(KeyDownEvent event) {
        if (event.isUpArrow()) {
          angle += Double.valueOf(incre.getText());
          angleBox.setText(angle + "");
View Full Code Here

        onRootMouseWheel(event);
      }     
    });       
   
    ((HasKeyDownHandlers) display.getRootWidget())
        .addKeyDownHandler(new KeyDownHandler() {
          public void onKeyDown(KeyDownEvent event) {
            int nativeKeyCode = event.getNativeKeyCode();
            if (orientation == Orientation.VERTICAL) {
              if (nativeKeyCode == KeyCodes.KEY_UP) {
                onRootKeyUpLeft();
View Full Code Here

                performClickAction(event);
            }
        });

        if (hotkeysEnabled) {
            focuser.addKeyDownHandler(new KeyDownHandler() {

                public void onKeyDown(@Nonnull final KeyDownEvent event) {
                    performKeyDownAction(event);
                }
            });
View Full Code Here

  public ChatWidget() {
    chat = new TextArea();
    chat.setWidth("400px");
    chat.setHeight("300px");
    messageBox = new TextBox();
    messageBox.addKeyDownHandler(new KeyDownHandler() {

      @Override
      public void onKeyDown(KeyDownEvent event) {
        if (event.getNativeKeyCode() == 13) {
          sendButton.click();
View Full Code Here

              + e.toString() + "</font>"));
      // Fatal error. Do not build the interface.
      return;
    }

    input.addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(KeyDownEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          insertPhrase();
        }
      }
View Full Code Here

        go.setEnabled(false);
        fireChange();
      }
    });
    go.setEnabled(false);
    gotoPage.addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(final KeyDownEvent event) {
        final int keyCode = event.getNativeKeyCode();
        DeferredCommand.addCommand(new Command() {
          public void execute() {
            int page = -1;
View Full Code Here

    text = new NpTextArea();
    text.setText(comment.getMessage());
    text.setCharacterWidth(INITIAL_COLS);
    text.setVisibleLines(INITIAL_LINES);
    text.setSpellCheck(true);
    text.addKeyDownHandler(new KeyDownHandler() {
      @Override
      public void onKeyDown(final KeyDownEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE
            && !event.isAnyModifierKeyDown()) {
          event.preventDefault();
View Full Code Here

      *
      *  A counter to this bug seems to be to force setFocus(false) on ESC.
      */

      /* Chrome does not create a KeyPressEvent on ESC, so use KeyDownEvents */
      keyDownHandler = addKeyDownHandler(new KeyDownHandler() {
          @Override
          public void onKeyDown(final KeyDownEvent event) {
            onKey(event.getNativeKeyCode());
          }
        });
View Full Code Here

TOP

Related Classes of com.google.gwt.event.dom.client.KeyDownHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.