mouse1_down = (device_flags & MOUSE_FLAG_DOWN) ? 0x01 : 0;
if (device_flags & MOUSE_FLAG_BUTTON2)
mouse2_down = (device_flags & MOUSE_FLAG_DOWN) ? 0x02 : 0;
+
+ printf("button mask = %x\n", mouse1_down | mouse2_down);
buf[0] = 5; // message type
buf[1] = mouse1_down | mouse2_down; // button mask
}
}
+int listen_on_vnc = 0;
+
int serve_client()
{
int vnc_sock = vnc_init();
- int listen_on_vnc = 0;
if (!mcs_recv_connect_initial())
error("MCS_CONNECT_INITIAL recv failed");
}
}
+ printf("LISTEN_ON_VNC=%u\n", listen_on_vnc);
+
// activity on VNC socket?
if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) {
unsigned char buf[256];
error("short read on vnc_sock\n");
if (read(vnc_sock, buf, 4) != 4)
error("short read on vnc_sock\n");
- if (read(vnc_sock, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3], 4) != 4)
+ if (read(vnc_sock, buf, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]) != 4)
error("short read on vnc_sock\n");
default: