Hi everyone.
I'm trying to create an simple app to send key presses/releases to be interpreted using WinAPI. Everything went fine, its all working. But now i've run into this problem:
I'm using SceCtrlLatch to get the changes on key states and send the 'events' (presses and releases) throught a simple UDP socket.
The problem is sometimes when you press two keys at the 'same' time (or in a short time) it does not send that packet or psp does not recongnize that.If that is a key release, it becomes really anoying, cause if you're running an emulator, it does not get the key release and mario keeps running foward, for example.
So my question is: what is the best way of doing it? Should i send them over TCP or anything like that?
Thanks in advance.
Best way to send key presses/releases through socket
-
- Posts: 37
- Joined: Wed Jan 14, 2009 5:53 am
Except if the PSP client sends like 5 times the single key press information in for example 100ms...Torch wrote:Application layer wifi is not suitable for sending keypresses in the first place. You will lose something.
in reciever, you configure it to ignore key repeat in a 100ms interval...
Information loss problem solved? xD
You shouldn't use UDP if you're going to merely transmit keystrokes. Use TCP instead. Here a few hints about why to do so:
http://en.wikipedia.org/wiki/Transmissi ... a_transfer
http://en.wikipedia.org/wiki/Transmissi ... a_transfer
I completely disagree. How can you play games over ad-hoc Wifi then? TCP is a reliable protocol. You don't have to lose a single thing.Torch wrote:Application layer wifi is not suitable for sending keypresses in the first place. You will lose something.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Games send updates of the game state, not button presses. And much much less frequently than button sampling rate. There is no way you can play something like Tekken if it sent button presses, where there are moves that require timing accurate up to 1/60th of a second known as just frame or single frame moves. Buttons are interpreted on the client side and only the resulting application action is sent to the server.m0skit0 wrote:I completely disagree. How can you play games over ad-hoc Wifi then? TCP is a reliable protocol. You don't have to lose a single thing.
Thanks for every answer. It was really helpful.
But the question is another:
The PSP CANNOT read every key press if there are too many at the same time.
I mean, i found that is not reliable to send one key press when the key is pressed.
Perhaps it would be nicier to send all the key states instead of each button at a time?
Any thoughts on that, guys?
Thanks a lot again!
But the question is another:
The PSP CANNOT read every key press if there are too many at the same time.
I mean, i found that is not reliable to send one key press when the key is pressed.
Perhaps it would be nicier to send all the key states instead of each button at a time?
Any thoughts on that, guys?
Thanks a lot again!