Ejemplo n.º 1
0
        // Reading global raw input
        private void VirtualCursorUpdate(ref Message m)
        {
            int      RidInput   = 0x10000003;
            int      headerSize = Marshal.SizeOf(typeof(RawInputHeader));
            int      size       = Marshal.SizeOf(typeof(RawInput));
            RawInput input;

            GetRawInputData(m.LParam, RidInput, out input, ref size, headerSize);
            RawMouse mouse = input.Mouse;

            if (!config.disableAutoDetection)
            {
                if (mouse.LastX > config.tolerance || mouse.LastY > config.tolerance)
                {
                    checkBox_tabletMode.Checked = true;
                    tabletMode = true;
                }
                else
                {
                    checkBox_tabletMode.Checked = false;
                    tabletMode = false;
                }
            }

            if (isDrawing)
            {
                if (tabletMode)
                {
                    Point offset = new Point(0, 0);
                    if (config.tabletOffsetOverride)
                    {
                        offset = config.tabletOffset;
                    }
                    int   tabletX = mouse.LastX * virtualWidth / 65536;
                    int   tabletY = mouse.LastY * virtualHeight / 65536;
                    Point p       = new Point(tabletX + offset.X + virtualLeft, tabletY + offset.Y + virtualTop);
                    position          = p;
                    overlay.cursorPos = p;
                    overlay.Invalidate();
                }
                else
                {
                    Point p = new Point(position.X + mouse.LastX, position.Y + mouse.LastY);
                    //if (p.X < virtualLeft) p.X = virtualLeft;
                    //if (p.X > virtualWidth) p.X = virtualWidth;
                    //if (p.Y < virtualTop) p.Y = virtualTop;
                    //if (p.Y > virtualHeight) p.Y = virtualHeight;
                    position          = p;
                    overlay.cursorPos = p;
                    overlay.Invalidate();
                }
            }
        }
Ejemplo n.º 2
0
 private void radioButton_bullseye_CheckedChanged(object sender, EventArgs e)
 {
     overlayForm.cursorType = Overlay.CursorType.Bullseye;
     overlayForm.Invalidate();
 }