private void doStroke(string str) // process keystroke(s) { //string key; str = str.Split(' ')[1]; str = str.Trim().Substring(14); // cause its GET[0] /sendStroke[1]{x}{x}... [2]http accept str = HttpUtility.UrlDecode(str); try { SendMK.sendKeystroke(str.ToString()); } catch (Exception) { str = ""; } }
private void doMouseClick(string str) { int x; int y; int button; str = str.Split(' ')[1]; str = str.Replace("%20", " "); str = str.Trim(); x = Convert.ToInt32(str.Split(' ')[1]); y = Convert.ToInt32(str.Split(' ')[2]); button = Convert.ToInt32(str.Split(' ')[3]); if (button == 1) { SendMK.sendMouseL(x, y); // dont put any offsets, fix in javascript, not here. 12/12/2007 DSW } else { SendMK.sendMouseR(x, y); // note the subtle difference, Left vs Right button... DSW } }
private void doMouseDrag(string str) { int startX; int endX; int startY; int endY; int button; str = str.Split(' ')[1]; // removes the "GET" str = str.Replace("%20", " "); str = str.Trim(); startX = (Convert.ToInt32(str.Split(' ')[1])); // this ignores the "/sendDrag" ([0]) and gets the first number after that... endX = (Convert.ToInt32(str.Split(' ')[2])); startY = (Convert.ToInt32(str.Split(' ')[3])); endY = (Convert.ToInt32(str.Split(' ')[4])); button = Convert.ToInt32(str.Split(' ')[5]); if (startX < System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width && startY < System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) { SendMK.sendDrag(startX, endX, startY, endY, button); // gotta rule out the out-of-bounds clicks. } }