Keep C++ Program to be always running - c++

I have C++ program written for Windows, which uses SendInput() to emulate keyboard keys. The program works and sends space key, which works fine in Icy Tower (Game) and the character keeps on jumping. However when I tried it with game like Counter Strike it didn't jump and when I tried pressing alt+tab to switch quickly between my program and the game I found the game to jump for once and the SendInput() makes it's way. So my guess is that when the program is in the background it doesn't send the keys to the game, is there a way to get around this?

Related

Sending mouse and keyboard input to a unity3d game (Rust)

I would like a python option but that doesn't seem likely, I looked into c++ but I'm not intimately familiar and the methods I tried were not working. I need to be able to move the mouse(which I have been able to do) inside the game (which never works), and to press and or hold keys, AutoHotKey doesn't work for moving the mouse inside of popup dialogs only for controlling recoil and such. I have permission from the admin, I admin on one of his other servers, I'm not looking to release hacks for the game, its just a project I dabbled with for a while and would like to see out.
Does anyone have experience with this or ideas as to how I can simulate input from mouse or keyboard?
i have expeience in ahk and game bot making
https://www.youtube.com/user/FloowSnaake/videos

Interact with another program from C++ (POSIX??)

I made my first GUI for Unix with QT. At the end of my GUI I start another program, which is based on python. There the user would need to press one button to complete the process.
Now I want to automate that last click. I already read a little about POSIX but I'm not quite sure if it can help me. I was thinking that, if I wont be able to access the programm directly, maybe I could at least set to mouse to a certain position and simulate a click? I know this solution is very dirty, but it might work because I will be using the GUI on one certain touch screen only

Windows Keybord display

I am trying to make an on screen keyboard for windows in C++ that rather than sends an input such as SendInput() takes intercepts the user inputs allowing the user to use a window and have the key press show on the on-screen keyboard.
I plan on using this as a way of making tutorials in programs such as unity and can be used as an overlay for people know play games. to do this I will need to take in the input without stopping it going to its destination but I don't know how.
Any help would be appreciated.

How to dump game data before closing C++ Windows

I am working on a project in which I put my data (I.E. Game world, mobs) into text files, which are read in when I run the game. This works perfectly fine. The game saves the data when I hit a key that exits the game loop, basically saving and then closing the game. However, I habitually hit the X on the top right of the console, and this obviously causes the game to close without saving. My question is, is there any way to run a function when somebody hits the close button on the console, and then close the program? I am working on Windows XP, C++, Console Program.
Closing a c++ console app with the "x" in the top corner throws an
CTRL_CLOSE_EVENT which you could catch and process if you set a
control handler using the SetConsoleCtrlHandler function. In there
you could override the close functionality and perform whatever you
wished to do, and then optionally still perform the default behavior.
What happens when you close a c++ console application

Down arrow key of my laptop?

The down arrow key of my laptop is very loose and it does not seems to last very long.
Is it possible to write any programm(in any language but especially C++) hat simulates the down arrow key.say I made a programm such that when I press A,B,C on the key board it simulates down arrow key.
If not then,
Is there any software available to do this?
Use the On-screen keyboard
If you want to simulate input, use the SendInput API. This injects input at a fairly low level, windows automatically routes it to the appropriate thread based on who has focus. Call it twice, once to send the key down, and again to send the key up.
Perhaps the easiest thing to do is to write a simple app that calls RegisterHotkey for some combination like ctrl-alt-Z, and then calls SendInput for a keypress then keyrelease of the down arrow key.
You might need to wait a short time after receiving WM_HOTKEY to give you time to release the set of hotkeys so that the down arrow gets processed alone without those modifiers from your hotkey interfering with it. (...otherwise the focused app might think you typed in shift+alt+downarrow instead of plain downarrow!)
if you're using linux, xmodmap: http://www.xfree86.org/4.2.0/xmodmap.1.html
I think that you are actually looking for Sharpkeys www.randyrants.com/sharpkeys/
This works with the windows registry and can be used to change mappings of keys.
You can easily write a program that sends WM_KEYDOWN and WM_KEYUP messages to the window which has the current focus. Once you have this program, bind it to a function key in the properties for the .exe file.