Next Generation Emulation banner
1 - 4 of 4 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Yeah... so I wanted a rapidfire/turbo button to use with Castlevania SotN, but noticed that neither ePSXe nor pSX have such a thing. Given that I know a little bit about programming, I thought it would be a good idea to try to make a simple program that could accomplish this for me.

So... basically what I wrote sends a keybd_event (in this case, NUMPAD8, which is what the [ ] key is set to in ePSXe) about every tenth of a second. I've tested the program with numerous different programs such as my source editor, notepad, firefox, PCSX2, ZSNES and it works fine with all of them. But not ePSXe... or pSX...

What gives? Why isn't ePSXe seeing the keybd_event? I was under the impression that that particular function is a system-wide event that the driver for the keyboard uses oO

If anyone here knows anything about this, I'd appreciate the help. Here's the code if that helps:

Code:
#include <windows.h>
#include <stdlib.h>
void PressKey(DWORD nSleepTime)
{
    keybd_event(VK_NUMPAD8, 0x75, KEYEVENTF_EXTENDEDKEY, 0);
    keybd_event(VK_NUMPAD8, 0xF075, KEYEVENTF_KEYUP, 0);
    Sleep(nSleepTime);
}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    while(!(GetAsyncKeyState(VK_F8)))
    {
        PressKey(100);
    }
    return 0;
}
 

·
Banned
Joined
·
23,263 Posts
PSX and epsxe use DirectInput for both joypad and keyboard mapping.
 

·
Registered
Joined
·
2 Posts
Discussion Starter · #3 ·
Okay. Well after several hours of googling to find some way of simulating a keypress so that it can be read with DirectInput, I've pretty much given up. I know it's possible from what I'm reading, but all this crap I'm finding is so far over my head it's just overwhelming for someone with very little coding experience like me.

So... if anyone knows of a program that can do what I was attempting to do with the code above, or knows a (hopefully simple?) way of accomplishing it in a simple source editor like Dev-C++, that would be great.
 
1 - 4 of 4 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top