private void SendTouch(float x, float y, int state) { try { if (Manipulator.ReadInt32(TOUCH_PANEL_CONNECTION_STATE) != 1) { Manipulator.WriteInt32(TOUCH_PANEL_CONNECTION_STATE, 1); } if (_isTouching) { var mousePos = new POINT((int)x, (int)y); var relPos = Manipulator.GetMouseRelativePos(mousePos); Manipulator.WriteSingle(TOUCH_PANEL_X_POSITION, relPos.X); Manipulator.WriteSingle(TOUCH_PANEL_Y_POSITION, relPos.Y); } Manipulator.WriteInt32(TOUCH_PANEL_CONTACT_TYPE, state); float pressure = state != 0 ? 1 : 0; Manipulator.WriteSingle(TOUCH_PANEL_PRESSURE, pressure); } catch (Exception) { Stop(); } }
public void Update() { Manipulator.GetClientRect(Manipulator.AttachedProcess.MainWindowHandle, out RECT hWindow); if (hWindow.Equals(lhWindow)) { return; } var uiWidth = hWindow.Right - hWindow.Left; var uiHeight = hWindow.Bottom - hWindow.Top; if (uiWidth == 0 || uiHeight == 0) { return; } Manipulator.WriteSingle(UI_ASPECT_RATIO, (float)(uiWidth) / (float)(uiHeight)); Manipulator.WriteDouble(FB_ASPECT_RATIO, (double)(uiWidth) / (double)(uiHeight)); Manipulator.WriteSingle(UI_WIDTH_ADDRESS, uiWidth); Manipulator.WriteSingle(UI_HEIGHT_ADDRESS, uiHeight); Manipulator.WriteInt32(FB1_WIDTH_ADDRESS, uiWidth); Manipulator.WriteInt32(FB1_HEIGHT_ADDRESS, uiHeight); var resWidth = Manipulator.ReadInt32(0x0000000140EDA8BC); var resHeight = Manipulator.ReadInt32(0x0000000140EDA8C0); Manipulator.WriteInt32(0x00000001411AD608, 0); // Set that f*****g whatever shitty checking flag to 0 Manipulator.WriteInt32(0x0000000140EDA8E4, resWidth); // RESOLUTION_WIDTH Manipulator.WriteInt32(0x0000000140EDA8E8, resHeight); // RESOLUTION_HEIGHT Manipulator.WriteSingle(0x00000001411A1900, 0); // WTF FROGGY? 0x00000001411A1870 + 0x90 Manipulator.WriteSingle(0x00000001411A1904, (float)resWidth); // RESOLUTION_WIDTH Manipulator.WriteSingle(0x00000001411A1908, (float)resHeight); // RESOLUTION_HEIGHT lhWindow = hWindow; }