Input Windows events no longer working

Need help? Ask here and someone will help
Post Reply
Jonny
Posts: 8
Joined: Sun Mar 17, 2019 12:22 am

Input Windows events no longer working

Post by Jonny »

This worked at one point now its not, no idea why, been years since I used GIMX, I used jitbit macro-recorder to record and play back and it worked back then great.

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);  
    }
}
Jonny
Posts: 8
Joined: Sun Mar 17, 2019 12:22 am

Re: Input Windows events no longer working

Post by Jonny »

Got it working.

I was using gimx 8.0, I downgraded to gimx 7.15 and it now recognizes the windows events keyboard input from that code and the macro program.

One thing I noticed that once you launch gimx you can't use the pc anymore, if you even move the gimx dos window it wont recognize windows events anymore and you have to close the dos window and press start on gimx to get it working again.
User avatar
GoDlike
Posts: 1318
Joined: Thu Apr 28, 2016 12:47 pm
Location: Poland

Re: Input Windows events no longer working

Post by GoDlike »

Maybe try just using network events?
My hardware: PS3 Slim CFW 4.80 | PS4 Pro 500 Million LE | PS5 | Xbox Series X
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
Jonny
Posts: 8
Joined: Sun Mar 17, 2019 12:22 am

Re: Input Windows events no longer working

Post by Jonny »

GoDlike wrote: Wed Feb 01, 2023 11:18 pm Maybe try just using network events?
Yep thats exactly what I was working on before I tried an older build or wire to the controller like Ben Heck did, but I have no idea how to do that https://www.youtube.com/watch?v=FbF-pZY12z4

I followed this example https://github.com/matlo/gimx-network-client and it works great you can use the pc communicate with gimx and still use the pc with the code & gimx in the background

Windows Event might require a dedicated pc but thats fine I got extra pc, this method with keyboard events seems like the simplest way of doing it, since I got it working I will mess around and see how finicky this is compared to network events.
Post Reply