Ejemplo n.º 1
0
        protected OnScreenKeyEventArgs RaisePreviewOnScreenKeyUpEvent()
        {
            var args = new OnScreenKeyEventArgs(PreviewOnScreenKeyUpEvent, this);

            RaiseEvent(args);
            return(args);
        }
Ejemplo n.º 2
0
        protected OnScreenKeyEventArgs RaiseOnScreenKeyPressEvent()
        {
            var args = new OnScreenKeyEventArgs(OnScreenKeyPressEvent, this);

            RaiseEvent(args);
            return(args);
        }
Ejemplo n.º 3
0
        void OnScreenKeyPress(DependencyObject sender, OnScreenKeyEventArgs e)
        {
            if (e.OnScreenKey.Key is ModifierKeyBase)
            {
                var modifierKey = (ModifierKeyBase)e.OnScreenKey.Key;
                if (modifierKey.KeyCode == VirtualKeyCode.SHIFT)
                {
                    //HandleShiftKeyPressed(modifierKey);
                }
                else if (modifierKey.KeyCode == VirtualKeyCode.CAPITAL)
                {
                    HandleCapsLockKeyPressed(modifierKey);
                }
                else if (modifierKey.KeyCode == VirtualKeyCode.NUMLOCK)
                {
                    //HandleNumLockKeyPressed(modifierKey);
                }
                //else if (modifierKey.KeyCode==VirtualKeyCode.RETURN)
                //{

                //}
            }
            else if (e.OnScreenKey.Key is VirtualKey)
            {
                VirtualKey vkey = e.OnScreenKey.Key as VirtualKey;
                if (vkey.KeyCode == VirtualKeyCode.RETURN)
                {
                    enterPress();
                }
            }
            else
            {
                e.OnScreenKey.Key.GetType();
                //LogicalKeyBase key= e.OnScreenKey.Key as LogicalKeyBase;
                //if (key. == VirtualKeyCode.RETURN)
                // {
                //     enterPress();
                // }
                ResetInstantaneousModifierKeys();
            }
            _modifierKeys.OfType <InstantaneousModifierKey>().ToList().ForEach(x => x.SynchroniseKeyState());
        }
Ejemplo n.º 4
0
 void OnScreenKeyPress(DependencyObject sender, OnScreenKeyEventArgs e)
 {
     if (e.OnScreenKey.Key is ModifierKeyBase)
     {
         var modifierKey = (ModifierKeyBase)e.OnScreenKey.Key;
         if (modifierKey.KeyCode == VirtualKeyCode.SHIFT)
         {
             HandleShiftKeyPressed(modifierKey);
         }
         else if (modifierKey.KeyCode == VirtualKeyCode.CAPITAL)
         {
             HandleCapsLockKeyPressed(modifierKey);
         }
         else if (modifierKey.KeyCode == VirtualKeyCode.NUMLOCK)
         {
             HandleNumLockKeyPressed(modifierKey);
         }
     }
     else
     {
         ResetInstantaneousModifierKeys();
     }
     _modifierKeys.OfType <InstantaneousModifierKey>().ToList().ForEach(x => x.SynchroniseKeyState());
 }
Ejemplo n.º 5
0
 protected OnScreenKeyEventArgs RaisePreviewOnScreenKeyUpEvent()
 {
     var args = new OnScreenKeyEventArgs(PreviewOnScreenKeyUpEvent, this);
     RaiseEvent(args);
     return args;
 }
Ejemplo n.º 6
0
 protected OnScreenKeyEventArgs RaiseOnScreenKeyPressEvent()
 {
     var args = new OnScreenKeyEventArgs(OnScreenKeyPressEvent, this);
     RaiseEvent(args);
     return args;
 }
Ejemplo n.º 7
0
        void OnScreenKeyPress(DependencyObject sender, OnScreenKeyEventArgs e)
        {
            if (e.OnScreenKey.Key is ModifierKeyBase)
            {
                var modifierKey = (ModifierKeyBase)e.OnScreenKey.Key;
                if (modifierKey.KeyCode == VirtualKeyCode.SHIFT)
                {
                    //HandleShiftKeyPressed(modifierKey);
                }
                else if (modifierKey.KeyCode == VirtualKeyCode.CAPITAL)
                {
                    HandleCapsLockKeyPressed(modifierKey);
                }
                else if (modifierKey.KeyCode == VirtualKeyCode.NUMLOCK)
                {
                    //HandleNumLockKeyPressed(modifierKey);
                }
                //else if (modifierKey.KeyCode==VirtualKeyCode.RETURN)
                //{

                //}
            }
            else if (e.OnScreenKey.Key is VirtualKey)
            {
                VirtualKey vkey = e.OnScreenKey.Key as VirtualKey;
                if (vkey.KeyCode==VirtualKeyCode.RETURN)
                {
                    enterPress();
                }
            }
            else
            {
                e.OnScreenKey.Key.GetType();
               //LogicalKeyBase key= e.OnScreenKey.Key as LogicalKeyBase;
               //if (key. == VirtualKeyCode.RETURN)
               // {
               //     enterPress();
               // }
                ResetInstantaneousModifierKeys();
            }
            _modifierKeys.OfType<InstantaneousModifierKey>().ToList().ForEach(x => x.SynchroniseKeyState());
        }
Ejemplo n.º 8
0
 void OnScreenKeyPress(DependencyObject sender, OnScreenKeyEventArgs e)
 {
     if (e.OnScreenKey.Key is ModifierKeyBase)
     {
         var modifierKey = (ModifierKeyBase)e.OnScreenKey.Key;
         if (modifierKey.KeyCode == VirtualKeyCode.SHIFT)
         {
             HandleShiftKeyPressed(modifierKey);
         }
         else if (modifierKey.KeyCode == VirtualKeyCode.CAPITAL)
         {
             HandleCapsLockKeyPressed(modifierKey);
         }
         else if (modifierKey.KeyCode == VirtualKeyCode.NUMLOCK)
         {
             HandleNumLockKeyPressed(modifierKey);
         }
     }
     else
     {
         ResetInstantaneousModifierKeys();
     }
     _modifierKeys.OfType<InstantaneousModifierKey>().ToList().ForEach(x => x.SynchroniseKeyState());
 }
Ejemplo n.º 9
0
        private void OnScreenKeyPress(DependencyObject sender, OnScreenKeyEventArgs e)
        {
            if (e.OnScreenKey.Key is ModifierKeyBase)
            {
                var modifierKey = (ModifierKeyBase)e.OnScreenKey.Key;
                switch (modifierKey.KeyCode)
                {
                    case VirtualKeyCode.SHIFT:
                        HandleShiftKeyPressed(modifierKey);
                        break;
                    case VirtualKeyCode.CONTROL:
                        HandleControlKeyPressed(modifierKey);
                        break;
                    case VirtualKeyCode.CAPITAL:
                        HandleCapsLockKeyPressed(modifierKey);
                        break;
                    case VirtualKeyCode.NUMLOCK:
                        HandleNumLockKeyPressed(modifierKey);
                        break;
                }
            }
            else
            {
                ResetInstantaneousModifierKeys();
            }

            _modifierKeys.OfType<InstantaneousModifierKey>().ToList().ForEach(x => x.SynchroniseKeyState());
        }