Create a proper class hierarchy for the input packets. Implement MouseButton and MouseMove packets. Fix DNS resolution bug in NvConnection. Mouse move events are working.

This commit is contained in:
Cameron Gutman
2013-09-27 18:59:51 -04:00
parent b256f41a25
commit b4de9cbf50
7 changed files with 327 additions and 137 deletions
@@ -22,9 +22,27 @@ public class NvController {
public void sendControllerInput(short buttonFlags, byte leftTrigger, byte rightTrigger,
short leftStickX, short leftStickY, short rightStickX, short rightStickY) throws IOException
{
out.write(new NvInputPacket(buttonFlags, leftTrigger,
out.write(new NvControllerPacket(buttonFlags, leftTrigger,
rightTrigger, leftStickX, leftStickY,
rightStickX, rightStickY).toWire());
out.flush();
}
public void sendMouseButtonDown() throws IOException
{
out.write(new NvMouseButtonPacket(true).toWire());
out.flush();
}
public void sendMouseButtonUp() throws IOException
{
out.write(new NvMouseButtonPacket(false).toWire());
out.flush();
}
public void sendMouseMove(short deltaX, short deltaY) throws IOException
{
out.write(new NvMouseMovePacket(deltaX, deltaY).toWire());
out.flush();
}
}