I was going through a code that had implementation of Robot() class in it. I did not understand the following method
public void mousePressed(MouseEvent e) {
System.out.println("Mouse Pressed");
writer.println(EnumCommands.PRESS_MOUSE.getAbbrev());
int button = e.getButton();
int xButton = 16;
if (button == 3) {
xButton = 4;
}
writer.println(xButton);
writer.flush();
}
This basically sends the MouseEvent to another PC using sockets of java. Could someone please explain why is the value of xButton set to 16 and what is happening in the if statement?