Turbine1991 Posted October 12, 2015 Share Posted October 12, 2015 I'm having an issue with Scar and Natural Selection 2, the key pressing facilities are not being sent to the window - although TypeText does work. Basically I am opening the console '`' (not sent), write the text (works), press enter (not sent), and then close the console (not sent). Is there a way I can get this to work? In the past I had to use a 3rd party program and pass values for it to press. Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 12, 2015 Share Posted October 12, 2015 Exactly what code are you using because it could very well be your Chr() usage. Quote Link to comment Share on other sites More sharing options...
Turbine1991 Posted October 13, 2015 Author Share Posted October 13, 2015 Thank you for responding. The exact things I've tried: PressVKey(VK_RETURN)PressKey(#13); VKeyDown(VK_RETURN); However this would work: PressKey('b'); The same thing happens in Simba. Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 15, 2015 Share Posted October 15, 2015 Looks like you're missing a KeyUp after paired with KeyDown Quote Link to comment Share on other sites More sharing options...
Turbine1991 Posted October 16, 2015 Author Share Posted October 16, 2015 Looks like you're missing a KeyUp after paired with KeyDown It doesn't work even with a delay between down and up. Looks like I'm going to have to use C#: http://stackoverflow.com/a/20898776 I must say, Pascal/Delphi isn't exactly the nicest language to code in. Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 16, 2015 Share Posted October 16, 2015 It doesn't work even with a delay between down and up. Looks like I'm going to have to use C#: http://stackoverflow.com/a/20898776 I must say, Pascal/Delphi isn't exactly the nicest language to code in. "Natural Selection 2" (video game) appears to have some type of game guard preventing non-genuine or otherwise simulated actions (unless done a certain way) to be registered in their game. Pascal/Delphi are not to blame for this. Unless you're talking about something off topic. Like OOP etc. which is another (off)topic entirely. Noted that this language was chosen for simplicity. You have to remember the purpose of a creating a coding environment that is easier to understand for the non-computer programmer. I'm not sure on this (because memory doesn't serve me at the moment, or what I'm allowed to disclose from higher boards) but I believe these are all things coming in the future for SCAR. Quote Link to comment Share on other sites More sharing options...