Package charva.awt.event

Examples of charva.awt.event.MouseEvent


  }
  else if (evt_ instanceof FocusEvent)
      processFocusEvent((FocusEvent) evt_);
  else if (evt_ instanceof MouseEvent) {

      MouseEvent e = (MouseEvent) evt_;
//      if (e.getModifiers() != MouseEvent.MOUSE_PRESSED)
//    return;

      processMouseEvent(e);
  }
View Full Code Here


        long current_time = System.currentTimeMillis();
        Component component = (Component) event.getSource();
        if (modifiers == MouseEvent.MOUSE_RELEASED &&
                current_time - _lastMousePressTime < 400L) {

            _evtQueue.postEvent(new MouseEvent(
                    component, MouseEvent.MOUSE_CLICKED, x, y, 1, button));

            // Check for a double-click.
            if (current_time - _lastMouseClickTime < 500L) {
                _evtQueue.postEvent(new MouseEvent(
                        component, MouseEvent.MOUSE_CLICKED, x, y, 2, button));
            }
            _lastMouseClickTime = current_time;
        }
    }
View Full Code Here

            while (isKeyboardReaderRunning()) {
                Object event = readKey();
               
                // identify the kind of event (key, mouse)
                int key = -1;
                MouseEvent mouseEvent = null;
                if(event == null)
                  break;
                else if(event instanceof Integer)
                  key = ((Integer) event).intValue();
                else if(event instanceof MouseEvent)
          mouseEvent = (MouseEvent) event;               

                if(mouseEvent != null)
                {
                    fireMouseEvent(mouseEvent);                 
                }
               
                /* Note that if the "kent" key is defined, ncurses returns
                 * VK_ENTER when the ENTER key is pressed; but some terminfo
                 * files don't define the "kent" capability.
                 */
                else if (key == '\n' || key == '\r')
                    key = KeyEvent.VK_ENTER;

                /* Likewise, some versions of curses don't map '\b' to
                 * VK_BACK_SPACE (Solaris at least); this works around
                 * that.  (I can't imagine anyone wanting \b to be mapped
                 * to anything else.  If they do, then they should set it
                 * up that way in the terminfo database.)
                 */
                else if (key == '\b')
                {
                    key = KeyEvent.VK_BACK_SPACE;
                }
                else
                {
                    fireKeystroke(key);
                }

                /* If script recording is on.
                 */
                if (_scriptPrintStream != null) {
                    scriptbuf.setLength(0);

                    /* Compute the elapsed time since the last keystroke.
                    */
                    long current = System.currentTimeMillis();
                    long elapsed = 1000;    // initial delay of 1 sec
                    if (_prevTimeMillis != 0)
                        elapsed = current - _prevTimeMillis;
                    _prevTimeMillis = current;
                    scriptbuf.append(elapsed).append(" ");

                    if (mouseEvent != null) {
                        scriptbuf.append("MOUSE ").
                                append(mouseEvent.getX()).
                                append(" ").
                                append(mouseEvent.getY());
                    } else {
                        scriptbuf.append("KEY ");
                        scriptbuf.append(Integer.toHexString(key));
                        scriptbuf.append(" ");
                        scriptbuf.append(key2ASCII(key));
View Full Code Here

            prevMouseX = x;
            prevMouseY = y;

            Component component = getComponentAt(x, y);
            if (component != null) {
                MouseEvent me = new MouseEvent(component, modifiers, x, y, 0,
                        button);
                keyQueue.add(me);
                keyQueue.notifyAll();
            }
        }
View Full Code Here

TOP

Related Classes of charva.awt.event.MouseEvent

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.