@@ -36,7 +36,6 @@ internal sealed class Task : ITask
3636 internal sealed class DoDive ( ICondition condition )
3737 : AbstractDelayedTaskExecutor < Task > ( TimeSpan . FromSeconds ( 5 ) )
3838 {
39- //private readonly Queue<(uint Type, nint Key)> _keysToPress = [];
4039 private int _attempts ;
4140
4241 protected override bool StartInternal ( )
@@ -62,22 +61,6 @@ private bool PerformDive()
6261 return false ;
6362 }
6463
65- //public override unsafe ETaskResult Update()
66- //{
67- // if (_keysToPress.TryDequeue(out var definition))
68- // {
69- // if (definition.Type == 0)
70- // return ETaskResult.StillRunning;
71-
72- // logger.LogDebug("{Action} key {KeyCode:X2}",
73- // definition.Type == NativeMethods.WM_KEYDOWN ? "Pressing" : "Releasing", definition.Key);
74- // NativeMethods.SendMessage((nint)Device.Instance()->hWnd, definition.Type, definition.Key, nint.Zero);
75- // return ETaskResult.StillRunning;
76- // }
77-
78- // return base.Update();
79- //}
80-
8164 public override bool ShouldInterruptOnDamage ( ) => false ;
8265
8366 protected override ETaskResult UpdateInternal ( )
@@ -92,74 +75,5 @@ protected override ETaskResult UpdateInternal()
9275 _attempts ++ ;
9376 return ETaskResult . StillRunning ;
9477 }
95-
96- //private unsafe void Descend()
97- //{
98- // var keyName = Utf8String.FromString("MOVE_DESCENT");
99- // var inputData = UIInputData.Instance();
100- // Keybind* keybind = inputData->GetKeybind(InputId.MOVE_DESCENT);
101-
102- // if (keybind == null)
103- // throw new TaskException("No keybind data found for diving");
104-
105- // if (keybind->KeySettings.Length == 0)
106- // throw new TaskException("No keybind found for diving");
107-
108- // foreach (var bind in keybind->KeySettings)
109- // {
110- // logger.LogDebug("Dive keybind option: Key={Key}, Modifier={Modifier}", bind.Key, bind.KeyModifier);
111- // }
112-
113- // List<List<nint>?> availableKeys = [GetKeysToPress(keybind->KeySettings[0].Key, keybind->KeySettings[0].KeyModifier)]; // Primary keybind
114-
115- // if (keybind->KeySettings.Length > 1)
116- // availableKeys.Add(GetKeysToPress(keybind->KeySettings[1].Key, keybind->KeySettings[1].KeyModifier)); // Add secondary keybind if it exists
117-
118- // List<nint>? realKeys = availableKeys.Where(x => x != null).Select(x => x!).MinBy(x => x.Count);
119- // if (realKeys == null || realKeys.Count == 0)
120- // throw new TaskException("No useable keybind found for diving");
121-
122- // foreach (var key in realKeys)
123- // {
124- // _keysToPress.Enqueue((NativeMethods.WM_KEYDOWN, key));
125- // _keysToPress.Enqueue((0, 0));
126- // _keysToPress.Enqueue((0, 0));
127- // }
128-
129- // for (int i = 0; i < 5; ++i)
130- // _keysToPress.Enqueue((0, 0)); // do nothing
131-
132- // realKeys.Reverse();
133- // foreach (var key in realKeys)
134- // _keysToPress.Enqueue((NativeMethods.WM_KEYUP, key));
135- //}
13678 }
137-
138- //private static List<nint>? GetKeysToPress(SeVirtualKey key, KeyModifierFlag modifier)
139- //{
140- // List<nint> keys = [];
141- // if (modifier.HasFlag(KeyModifierFlag.Ctrl))
142- // keys.Add(0x11); // VK_CONTROL
143- // if (modifier.HasFlag(KeyModifierFlag.Shift))
144- // keys.Add(0x10); // VK_SHIFT
145- // if (modifier.HasFlag(KeyModifierFlag.Alt))
146- // keys.Add(0x12); // VK_MENU
147-
148- // nint mappedKey = (nint)key;
149- // if (mappedKey == 0)
150- // return null;
151-
152- // keys.Add(mappedKey);
153- // return keys;
154- //}
155-
156- //private static class NativeMethods
157- //{
158- // public const uint WM_KEYUP = 0x101;
159- // public const uint WM_KEYDOWN = 0x100;
160-
161- // [DllImport("user32.dll", CharSet = CharSet.Auto)]
162- // [DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
163- // public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, nint wParam, nint lParam);
164- //}
16579}
0 commit comments