void updateMouse (MouseEvent e, boolean pressed, boolean released,
                      boolean inside) {
        mousepos = e.getPoint();
        mousepos.x = (int) ((mousepos.x/*-el.canvas_xofs*/) / el.x_scale_fac);
        mousepos.y = (int) ((mousepos.y/*-el.canvas_yofs*/) / el.y_scale_fac);
        mouseinside = inside;
        int button = 0;
        if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) button = 1;
        if ((e.getModifiers() & InputEvent.BUTTON2_MASK) != 0) button = 2;
        if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) button = 3;
        if (button == 0) return;
        if (pressed) {
            mousebutton[button] = true;
            keymap[255 + button] = true;
            if (wakeup_key == -1 || wakeup_key == 255 + button) {
                if (!eng.isRunning()) {
                    eng.start();
                    // mouse button is cleared when it is used as wakeup key
                    mousebutton[button] = false;
                    keymap[255 + button] = false;
                }
            }
        }
        if (released) {
            mousebutton[button] = false;
            keymap[255 + button] = false;
        }
    }