Ejemplo n.º 1
0
        /// <summary> called on keyboard activity </summary>
        private void KeyPressed(object sender, InputDevice.RawKeyEventArgs e)
        {
            if (ScreenPrintPress != null)
            {
                if (e.vKey == Keys.PrintScreen &&
                    _shiftPressed && _controlPressed)
                {
                    //Console.WriteLine("KeyDn: " + e.vKey);
                    ScreenPrintPress.Invoke(this, new ScreenPrintPressEventArgs(ScreenPrintKind.Manual));
                }
                else if (e.vKey == Keys.PrintScreen && _shiftPressed)
                {
                    //Console.WriteLine("KeyDn: " + e.vKey);
                    ScreenPrintPress.Invoke(this, new ScreenPrintPressEventArgs(ScreenPrintKind.FullAuto));
                }
                else if (e.vKey == Keys.PrintScreen && _controlPressed)
                {
                    //Console.WriteLine("KeyDn: " + e.vKey);
                    ScreenPrintPress.Invoke(this, new ScreenPrintPressEventArgs(ScreenPrintKind.TopWindowAuto));
                }

                if (e.vKey == Keys.ControlKey)
                {
                    //Console.WriteLine("KeyDn: " + e.vKey);
                    _controlPressed = true;
                }
                if (e.vKey == Keys.ShiftKey)
                {
                    //Console.WriteLine("KeyDn: " + e.vKey);
                    _shiftPressed = true;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary> called upon keyboard activity </summary>
 private void KeyReleased(object sender, InputDevice.RawKeyEventArgs e)
 {
     if (ScreenPrintPress != null)
     {
         if (e.vKey == Keys.ControlKey)
         {
             //Console.WriteLine("KeyUp: " + e.vKey);
             _controlPressed = false;
         }
         if (e.vKey == Keys.ShiftKey)
         {
             //Console.WriteLine("KeyUp: " + e.vKey);
             _shiftPressed = false;
         }
     }
 }