public static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0) { int vkCode = Marshal.ReadInt32(lParam); System.Windows.Forms.Keys key = (System.Windows.Forms.Keys)vkCode; if (MainWindow.current.isFullscreen) { if (key == System.Windows.Forms.Keys.Scroll) { MainWindow.current.ExitFullscreenMode(null, null); } } { if (MainWindow.current.arole == 0) { if (key == System.Windows.Forms.Keys.LWin || key == System.Windows.Forms.Keys.RWin || key == System.Windows.Forms.Keys.Scroll || key == System.Windows.Forms.Keys.LShiftKey || key == System.Windows.Forms.Keys.RShiftKey) { ControlsStreamer.keyboardButtonPressed(key); return((IntPtr)1); // Handled. } } } } return(InterceptKeys.CallNextHookEx(_hookID, nCode, wParam, lParam)); }
protected override void OnKeyDown(KeyEventArgs e) { if (e.Key == Key.LeftAlt || e.Key == Key.RightAlt || e.Key == Key.Space || e.Key == Key.Enter || e.SystemKey == Key.LeftAlt || e.SystemKey == Key.RightAlt || e.SystemKey == Key.Space || e.SystemKey == Key.Enter) { e.Handled = true; ControlsStreamer.keyboardButtonPressed(e); } else { base.OnKeyDown(e); } }
private void VideoObject_KeyDown_1(object sender, KeyEventArgs e) { ControlsStreamer.keyboardButtonPressed(e); }