Compare commits
3 Commits
740d3d8b01
...
c28bc4ac69
Author | SHA1 | Date | |
---|---|---|---|
c28bc4ac69 | |||
04cb6c1e38 | |||
50f7c777b3 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.idea
|
||||
obj
|
||||
bin
|
||||
.vs
|
@@ -19,6 +19,9 @@ internal static class Program {
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern short GetKeyState(int nVirtKey);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return:MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool AllocConsole();
|
||||
@@ -202,6 +205,10 @@ internal static class Program {
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsScrollLockOn() {
|
||||
return (GetKeyState(0x91) & 1) == 1;
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
private static void Main() {
|
||||
// AllocConsole();
|
||||
@@ -216,8 +223,7 @@ internal static class Program {
|
||||
Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
|
||||
long delLast = 0;
|
||||
HotKeyManager.RegisterHotKey(Keys.End, KeyModifiers.NoRepeat);
|
||||
HotKeyManager.RegisterHotKey(Keys.Scroll, KeyModifiers.NoRepeat);
|
||||
// Register main number keys (0-9)
|
||||
for (int i = 0; i < 10; i++)
|
||||
HotKeyManager.RegisterHotKey(Keys.D0 + i, KeyModifiers.Alt);
|
||||
@@ -235,10 +241,6 @@ internal static class Program {
|
||||
return;
|
||||
}
|
||||
|
||||
long now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
if (e.Key == Keys.End)
|
||||
delLast = now;
|
||||
|
||||
int index;
|
||||
if (e.Key >= Keys.D0 && e.Key <= Keys.D9) {
|
||||
index = e.Key - Keys.D0;
|
||||
@@ -248,12 +250,9 @@ internal static class Program {
|
||||
return;
|
||||
}
|
||||
|
||||
long cocksucker = DateTime.Now.Second;
|
||||
Console.WriteLine(cocksucker);
|
||||
if (e.Modifiers == KeyModifiers.Alt) {
|
||||
if (now - delLast <= 1) {
|
||||
if (IsScrollLockOn()) {
|
||||
Swap(index);
|
||||
delLast = 0;
|
||||
} else {
|
||||
TabTo(index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user