lizar
January 21, 2018, 8:36pm
1
Hi,
I want to write a simple C# script to double-click a entry in the probe scanner window. I tried the “MouseDoubleClick” method which isn’t working, as eve only recognizes a single click. Eve probably wants a slight delay between the two clicks, now my question is how can I achieve this?
Viir
(Michael Rätzel)
January 22, 2018, 12:17am
2
In the latest version, I see code for a delay at following locations:
var MotionTextEntry = Motion?.TextEntry;
var mouseLocationOnScreen = MotionMousePosition.HasValue ? WindowHandle.ClientToScreen(MotionMousePosition.Value) + MouseOffsetStatic : null;
if (mouseLocationOnScreen.HasValue || (Motion.WindowToForeground ?? false))
EnsureWindowIsForeground();
if (mouseLocationOnScreen.HasValue)
{
User32.SetCursorPos((int)mouseLocationOnScreen.Value.A, (int)mouseLocationOnScreen.Value.B);
Thread.Sleep(MouseEventTimeDistanceMilli);
}
var mouseSetAction = new[]
{
Motion?.MouseButtonDown?.Select(button => new KeyValuePair<MouseButtonIdEnum, bool>(button, true)),
Motion?.MouseButtonUp?.Select(button => new KeyValuePair<MouseButtonIdEnum, bool>(button, false)),
}.ConcatNullable().ToArray();
if (0 < mouseSetAction?.Length)
{
{
Motion?.MouseButtonDown?.Select(button => new KeyValuePair<MouseButtonIdEnum, bool>(button, true)),
Motion?.MouseButtonUp?.Select(button => new KeyValuePair<MouseButtonIdEnum, bool>(button, false)),
}.ConcatNullable().ToArray();
if (0 < mouseSetAction?.Length)
{
foreach (var mouseAction in mouseSetAction)
mouseActionFromButtonIdAndState?.TryGetValueOrDefault(mouseAction)?.Invoke(InputSimulator.Mouse);
Thread.Sleep(MouseEventTimeDistanceMilli);
}
Motion?.KeyDown?.ForEach(keyDown =>
{
EnsureWindowIsForeground();
InputSimulator.Keyboard.KeyDown(keyDown);
Thread.Sleep(KeyboardEventTimeDistanceMilli);
});
Motion?.KeyUp?.ForEach(keyUp =>
Therefore my suggestion to achieve the slight delay is to download and try the latest version from Releases · Arcitectus/Sanderling · GitHub
lizar
January 22, 2018, 4:38pm
3
OK, I got it working. The standard delay of 140 ms is too long for eve and so it recognizes a double click as two single clicks, it works properly with a delay of 120 ms.
Thanks.
1 Like