Exemplo n.º 1
0
        public MouseWinforms(InputSourceWinforms source, Control uiControl)
        {
            Source         = source;
            this.uiControl = uiControl;

            uiControl.MouseMove           += OnMouseMove;
            uiControl.MouseDown           += OnMouseDown;
            uiControl.MouseUp             += OnMouseUp;
            uiControl.MouseWheel          += OnMouseWheelEvent;
            uiControl.MouseCaptureChanged += OnLostMouseCapture;
            uiControl.SizeChanged         += OnSizeChanged;

            OnSizeChanged(this, null);
        }
Exemplo n.º 2
0
        public KeyboardWinforms(InputSourceWinforms source, Control uiControl)
        {
            Source         = source;
            this.uiControl = uiControl;

            richTextBox = new RichTextBox
            {
                Location = new Point(-100, -100),
                Size     = new Size(80, 80)
            };

            // Assign custom window procedure to this text box
            wndProcDelegate = WndProc;
            var windowProc = Marshal.GetFunctionPointerForDelegate(wndProcDelegate);

            oldWndProc = Win32Native.SetWindowLong(richTextBox.Handle, Win32Native.WindowLongType.WndProc, windowProc);
        }