Now that is not working anymore example old post I made years ago https://forum.gimx.fr/viewtopic.php?p=16667#p16667
I am using C++ code to do what that program does, but neither of them are working anymore, a lot has changed my pc config, windows upgraded 7 to 10 not sure if that matters?
I did my best to debug this but setting Gimx settings Input to Window events nothing gets detected, below I have code that just press space bar, and space bar is bound to options button (ps4).
When I have Input Physical Devices it presses options when I press the spacebar, also binding the key with Auto detect Gimx detects the code below as a space bar press but when I run the code it doesn't detect anything pressed with my c++ code or jitbit macro recorder anymore, no idea why.
Code: Select all
#include <windows.h>
#include <iostream>
void main(){
std::cout << "5 sec... pressing space bar every 1 sec" << std::endl;
Sleep(5000);
while (true){
// Simulate a key press
keybd_event(VK_SPACE,0x39,KEYEVENTF_EXTENDEDKEY | 0,0);
Sleep(200);
// Simulate a key release
keybd_event(VK_SPACE,0x39,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
std::cout << "space bar" << std::endl;
Sleep(1000);
}
}