public KeyboardSDL(InputSourceSDL source, Window window) { Source = source; this.window = window; this.window.KeyDownActions += OnKeyEvent; this.window.KeyUpActions += OnKeyEvent; this.window.TextInputActions += OnTextInputActions; this.window.TextEditingActions += OnTextEditingActions; Id = InputDeviceUtils.DeviceNameToGuid(window.SdlHandle.ToString() + Name); }
public MouseSDL(InputSourceSDL source, Window uiControl) { Source = source; this.uiControl = uiControl; uiControl.MouseMoveActions += OnMouseMoveEvent; uiControl.PointerButtonPressActions += OnMouseInputEvent; uiControl.PointerButtonReleaseActions += OnMouseInputEvent; uiControl.MouseWheelActions += OnMouseWheelEvent; uiControl.ResizeEndActions += OnSizeChanged; OnSizeChanged(new SDL.SDL_WindowEvent()); Id = InputDeviceUtils.DeviceNameToGuid(uiControl.SdlHandle.ToString() + Name); }
public PointerSDL(InputSourceSDL source, Window uiControl) { Source = source; this.uiControl = uiControl; // Disable Touch-Mouse synthesis SDL.SetHint(Sdl.HintTouchMouseEvents, "false"); uiControl.FingerMoveActions += OnFingerMoveEvent; uiControl.FingerPressActions += OnFingerPressEvent; uiControl.FingerReleaseActions += OnFingerReleaseEvent; uiControl.ResizeEndActions += OnSizeChanged; OnSizeChanged(new WindowEvent()); Id = InputDeviceUtils.DeviceNameToGuid(uiControl.SdlHandle.ToString() + Name); }
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; uiControl.GotFocus += OnGotFocus; OnSizeChanged(this, null); BindRawInput(); Id = InputDeviceUtils.DeviceNameToGuid(uiControl.Handle.ToString() + Name); }
public KeyboardWinforms(InputSourceWinforms source, Control uiControl) { Source = source; winformSource = 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); Id = InputDeviceUtils.DeviceNameToGuid(uiControl.Handle.ToString() + Name); }
/// <summary> /// Initializes a new instance of the <see cref="Sensor"/> class. /// </summary> protected Sensor(IInputSource source, string systemName, string sensorName) { Source = source; Name = $"{systemName} {sensorName} Sensor"; Id = InputDeviceUtils.DeviceNameToGuid(systemName + sensorName); }