Alt + click commander window to click through

This commit is contained in:
Kang Yu 2024-05-01 19:38:47 -07:00
parent c0382f0f85
commit fe86137062
2 changed files with 14 additions and 8 deletions

View file

@ -96,10 +96,10 @@
| U (or Shift + T) | Ctrl + Shift + T | Undo close tab
| V | | goto the most recently visited tab
| N | Ctrl + N | New browser window
| H | | scroll left
| J | | scroll down
| K | | scroll up
| L | | scroll right
| H | Left | scroll left
| J | Down | scroll down
| K | Up | scroll up
| L | Right | scroll right
| Space (or left click in commander window) | | Page down
| P (or right click in commander window) | | page up
| Z | | Zoom in/out (toggle the size of commander window)

View file

@ -194,16 +194,22 @@ namespace PersistentWindows.Common
clickThrough = true;
if (clickThrough)
Visible = false;
Left -= 10;
IntPtr fgwnd = GetForegroundWindow();
User32.SetForegroundWindow(fgwnd);
if (clickThrough)
{
User32.mouse_event(MouseAction.MOUSEEVENTF_LEFTDOWN | MouseAction.MOUSEEVENTF_LEFTUP,
8, 0, 0, UIntPtr.Zero);
Visible = true;
if (e.Button == MouseButtons.Left)
User32.mouse_event(MouseAction.MOUSEEVENTF_LEFTDOWN | MouseAction.MOUSEEVENTF_LEFTUP,
0, 0, 0, UIntPtr.Zero);
else if (e.Button == MouseButtons.Right)
User32.mouse_event(MouseAction.MOUSEEVENTF_RIGHTDOWN | MouseAction.MOUSEEVENTF_RIGHTUP,
0, 0, 0, UIntPtr.Zero);
clickThrough = false;
Thread.Sleep(3000);
Left += 10;
return;
}
if (e.Button == MouseButtons.Left)