Protocol: Keyboard/mouse starts at socket 100. protocol structure: byte 1: command. 1 = mouse move 2 = mouse down 3 = mouse up 4 = key down 5 = key up byte 2: pad (0) byte 3: start of payload mouse move payload: 2 bytes absolute x coordinate 2 bytes absolute y coordinate example mouse move command: sudo ./ddp -s 101 --hex 0100005000A0 mouse down/up has no payload. example mouse click: sudo ./ddp -s 101 --hex 0200 ; sudo ./ddp -s 101 --hex 0300 keyboard payload consists of: 1 byte key scan code # most things don't actually use this code 1 byte ascii code 2 bytes modifiers +-------------------------------------+ |15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0| +-------------------------------------+ | | | | | | | | | | | +---> 1 if window is being activated | | | | +-----------------> 1 if mouse is up | | | +-------------------> 1 if cmd key is down | | +---------------------> 1 if shift key is down | +------------------------> 1 if capslock is down +---------------------------> 1 if option key is down example keydown for cmd-q: sudo ./ddp -s 100 --hex 04000C710181 Note: all hex must be upper case for the command line tool