Base logic off of scroll lock toggle instead of whatever the fuck we had previously
This commit is contained in:
@@ -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,7 +223,6 @@ internal static class Program {
|
||||
Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
|
||||
long delLast = 0;
|
||||
HotKeyManager.RegisterHotKey(Keys.Scroll, KeyModifiers.NoRepeat);
|
||||
// Register main number keys (0-9)
|
||||
for (int i = 0; i < 10; i++)
|
||||
@@ -235,10 +241,6 @@ internal static class Program {
|
||||
return;
|
||||
}
|
||||
|
||||
long now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
if (e.Key == Keys.Scroll)
|
||||
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