Exemplo n.º 1
0
        private void CbGlobalSwitch_Checked(object sender, RoutedEventArgs e)
        {
            // DeepDarkWin32Fantasy.SetHook(DeepDarkWin32Fantasy.InputHookCallback);
            var windowHandle = new WindowInteropHelper(this).EnsureHandle();

            _rawinput = new RawInput(windowHandle, CaptureOnlyInForeground);

            _rawinput.AddMessageFilter();   // Adding a message filter will cause keypresses to be handled
            Win32.DeviceAudit();            // Writes a file DeviceAudit.txt to the current directory

            _rawinput.JoystickEvent += OnKeyPressed;
        }
Exemplo n.º 2
0
 private void CbGlobalSwitch_Unchecked(object sender, RoutedEventArgs e)
 {
     _rawinput.JoystickEvent -= OnKeyPressed;
     _rawinput = null;
 }