Exemplo n.º 1
0
 private void ChangeBar()
 {
     if (_bar != MicrosoftVirtualKeys.Indifferent)
     {
         KeyLowHelper.PostMessage(Memory.WindowHandle, PressKeyCode, (IntPtr)MicrosoftVirtualKeys.VK_SHIFT, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, PressKeyCode, (IntPtr)_bar, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)MicrosoftVirtualKeys.VK_SHIFT, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_bar, (IntPtr)0);
         Thread.Sleep(350);
     }
 }
Exemplo n.º 2
0
 public void ReleaseKey()
 {
     ChangeBar();
     if (!_shift)
     {
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam2, (IntPtr)0);
     }
     if (_shift)
     {
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam2, (IntPtr)0);
     }
 }
Exemplo n.º 3
0
 public void SendKey()
 {
     Logging.Debug("SendKey: " + Name + " Bar: " + Bar + " Key: " + Key);
     ChangeBar();
     if (!_shift)
     {
         KeyLowHelper.PostMessage(Memory.WindowHandle, PressKeyCode, (IntPtr)_wParam2, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam2, (IntPtr)0);
     }
     if (_shift)
     {
         KeyLowHelper.PostMessage(Memory.WindowHandle, PressKeyCode, (IntPtr)_wParam, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, PressKeyCode, (IntPtr)_wParam2, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam, (IntPtr)0);
         KeyLowHelper.PostMessage(Memory.WindowHandle, ReleaseKeyCode, (IntPtr)_wParam2, (IntPtr)0);
     }
 }