First post, by pimlottc
I've recently been play Shadows of Yserbius on innrevival, thanks in no small part to DOSbox. But the game bugs me by requiring the mouse for most actions.
So I have been trying to create a crude "mousekeys" sort of system where I can bind keys to mouse clicks on specific coordinates.
Right now, I'm doing this by using functions from ints/mouse.cpp (Mouse_CursorSet and Mouse_ButtonPressed). I found, though, that if I call Mouse_ButtonPressed followed immediately by Mouse_ButtonReleased, it doesn't register a click. I figure this is because the system needs some time to process the click, otherwise my instantaneous release basically negates the press before the system sees it.
My work around is to bind Mouse_ButtonPressed to the KEYDOWN event and Mouse_ButtonRelease to the KEYUP. Which basically works, but this limits it to keys that generate KEYUP events.
I tried doing the press, forking, sleeping in the child and then doing a release, but that doesn't seem to work at all (the release never seems to happen, the game thinks the mouse button is still held down until I manually click a second time).
So I could use some advice on how to fix my problem. Or maybe I'm going about this the wrong way, and there's a better way I should be looking at to fake mouse events. I'm not that familiar with SDL or DOS programming so I'd appreciate any help more experienced people could offer. Thanks.