static void pointer_event(VncState *vs, int button_mask, int x, int y)

{

    static uint32_t bmap[INPUT_BUTTON_MAX] = {

        [INPUT_BUTTON_LEFT]       = 0x01,

        [INPUT_BUTTON_MIDDLE]     = 0x02,

        [INPUT_BUTTON_RIGHT]      = 0x04,

        [INPUT_BUTTON_WHEEL_UP]   = 0x08,

        [INPUT_BUTTON_WHEEL_DOWN] = 0x10,

    };

    QemuConsole *con = vs->vd->dcl.con;

    int width = surface_width(vs->vd->ds);

    int height = surface_height(vs->vd->ds);



    if (vs->last_bmask != button_mask) {

        qemu_input_update_buttons(con, bmap, vs->last_bmask, button_mask);

        vs->last_bmask = button_mask;

    }



    if (vs->absolute) {

        qemu_input_queue_abs(con, INPUT_AXIS_X, x, width);

        qemu_input_queue_abs(con, INPUT_AXIS_Y, y, height);

    } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {

        qemu_input_queue_rel(con, INPUT_AXIS_X, x - 0x7FFF);

        qemu_input_queue_rel(con, INPUT_AXIS_Y, y - 0x7FFF);

    } else {

        if (vs->last_x != -1) {

            qemu_input_queue_rel(con, INPUT_AXIS_X, x - vs->last_x);

            qemu_input_queue_rel(con, INPUT_AXIS_Y, y - vs->last_y);

        }

        vs->last_x = x;

        vs->last_y = y;

    }

    qemu_input_event_sync();

}

static void pointer_event(VncState *vs, int button_mask, int x, int y)

{

    static uint32_t bmap[INPUT_BUTTON_MAX] = {

        [INPUT_BUTTON_LEFT]       = 0x01,

        [INPUT_BUTTON_MIDDLE]     = 0x02,

        [INPUT_BUTTON_RIGHT]      = 0x04,

        [INPUT_BUTTON_WHEEL_UP]   = 0x08,

        [INPUT_BUTTON_WHEEL_DOWN] = 0x10,

    };

    QemuConsole *con = vs->vd->dcl.con;

    int width = surface_width(vs->vd->ds);

    int height = surface_height(vs->vd->ds);



    if (vs->last_bmask != button_mask) {

        qemu_input_update_buttons(con, bmap, vs->last_bmask, button_mask);

        vs->last_bmask = button_mask;

    }



    if (vs->absolute) {

        qemu_input_queue_abs(con, INPUT_AXIS_X, x, width);

        qemu_input_queue_abs(con, INPUT_AXIS_Y, y, height);

    } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {

        qemu_input_queue_rel(con, INPUT_AXIS_X, x - 0x7FFF);

        qemu_input_queue_rel(con, INPUT_AXIS_Y, y - 0x7FFF);

    } else {

        if (vs->last_x != -1) {

            qemu_input_queue_rel(con, INPUT_AXIS_X, x - vs->last_x);

            qemu_input_queue_rel(con, INPUT_AXIS_Y, y - vs->last_y);

        }

        vs->last_x = x;

        vs->last_y = y;

    }

    qemu_input_event_sync();

}

    int width = surface_width(vs->vd->ds);     int height = surface_height(vs->vd->ds);
static void FUNC_0(VncState *VAR_0, int VAR_1, int VAR_2, int VAR_3)

{

    static uint32_t VAR_4[INPUT_BUTTON_MAX] = {

        [INPUT_BUTTON_LEFT]       = 0x01,

        [INPUT_BUTTON_MIDDLE]     = 0x02,

        [INPUT_BUTTON_RIGHT]      = 0x04,

        [INPUT_BUTTON_WHEEL_UP]   = 0x08,

        [INPUT_BUTTON_WHEEL_DOWN] = 0x10,

    };

    QemuConsole *con = VAR_0->vd->dcl.con;

    int VAR_5 = surface_width(VAR_0->vd->ds);

    int VAR_6 = surface_height(VAR_0->vd->ds);



    if (VAR_0->last_bmask != VAR_1) {

        qemu_input_update_buttons(con, VAR_4, VAR_0->last_bmask, VAR_1);

        VAR_0->last_bmask = VAR_1;

    }



    if (VAR_0->absolute) {

        qemu_input_queue_abs(con, INPUT_AXIS_X, VAR_2, VAR_5);

        qemu_input_queue_abs(con, INPUT_AXIS_Y, VAR_3, VAR_6);

    } else if (vnc_has_feature(VAR_0, VNC_FEATURE_POINTER_TYPE_CHANGE)) {

        qemu_input_queue_rel(con, INPUT_AXIS_X, VAR_2 - 0x7FFF);

        qemu_input_queue_rel(con, INPUT_AXIS_Y, VAR_3 - 0x7FFF);

    } else {

        if (VAR_0->last_x != -1) {

            qemu_input_queue_rel(con, INPUT_AXIS_X, VAR_2 - VAR_0->last_x);

            qemu_input_queue_rel(con, INPUT_AXIS_Y, VAR_3 - VAR_0->last_y);

        }

        VAR_0->last_x = VAR_2;

        VAR_0->last_y = VAR_3;

    }

    qemu_input_event_sync();

}

static void FUNC_0(VncState *VAR_0, int VAR_1, int VAR_2, int VAR_3)
{ static uint32_t VAR_4[INPUT_BUTTON_MAX] = { [INPUT_BUTTON_LEFT]       = 0x01,
[INPUT_BUTTON_MIDDLE]     = 0x02,
[INPUT_BUTTON_RIGHT]      = 0x04,
[INPUT_BUTTON_WHEEL_UP]   = 0x08,
[INPUT_BUTTON_WHEEL_DOWN] = 0x10,
}; QemuConsole *con = VAR_0->vd->dcl.con; int VAR_5 = surface_width(VAR_0->vd->ds); int VAR_6 = surface_height(VAR_0->vd->ds); if (VAR_0->last_bmask != VAR_1) { qemu_input_update_buttons(con, VAR_4, VAR_0->last_bmask, VAR_1); VAR_0->last_bmask = VAR_1; } if (VAR_0->absolute) { qemu_input_queue_abs(con, INPUT_AXIS_X, VAR_2, VAR_5); qemu_input_queue_abs(con, INPUT_AXIS_Y, VAR_3, VAR_6); } else if (vnc_has_feature(VAR_0, VNC_FEATURE_POINTER_TYPE_CHANGE)) { qemu_input_queue_rel(con, INPUT_AXIS_X, VAR_2 - 0x7FFF); qemu_input_queue_rel(con, INPUT_AXIS_Y, VAR_3 - 0x7FFF); } else { if (VAR_0->last_x != -1) { qemu_input_queue_rel(con, INPUT_AXIS_X, VAR_2 - VAR_0->last_x); qemu_input_queue_rel(con, INPUT_AXIS_Y, VAR_3 - VAR_0->last_y); } VAR_0->last_x = VAR_2; VAR_0->last_y = VAR_3; } qemu_input_event_sync(); }