InputSimulator in C# and eve online

hi I’m trying to use InputSimulator in a C# eve online Bot that I’m working on.
I’m tying to open the probe scanner with alt-p, the game gets the alt key and holds it but that’s it.

I have tried:

InputSimulator sim = new InputSimulator();
sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.MENU, VirtualKeyCode.VK_P);

and

InputSimulator sim = new InputSimulator();
sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.MENU, new[] { VirtualKeyCode.VK_P });

classes:
using WindowsInput.Native;
using WindowsInput;

any help you guys can give would be appreciated.

1 Like

more infos you find here ( if you want to use on A-bot): Avoiding to struggle - a guide for beginers

				yield return new BotTask //open windowprobes
					{
						Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] 
						{
								   VirtualKeyCode.LMENU, VirtualKeyCode.VK_P
						}) }

					};

if you want to use on a Sanderling script,
if (probeScannerWindow == null)

Sanderling.KeyboardPressCombined(new { VirtualKeyCode.LMENU, VirtualKeyCode.VK_P });

more examples for a sanderling script you finde at ( and check the master branch/last commit on git):

and here

2 Likes

if you want to avoid spagetti code, I’d recommend to define shortcut class something like:

public class KeyShortcuts
	{
		public static VirtualKeyCode[]
			Key_ProbeScanner = { VirtualKeyCode.MENU, VirtualKeyCode.VK_P },
}

and then when you need it simply call

if (null == MemoryMeasurement?.WindowProbeScanner)
	yield return KeyShortcuts.Key_ProbeScanner.KeyboardPressCombined();

then you can maintain all your shorcut keys at one place instead of searching whole code over and over again.

Cheers

2 Likes

Cool Thx, ya I’m trying some bots out. lots of good ones here. lol most of the ones i see are from you guys.