Cloudy, on 28 December 2012 - 02:28 PM, said:
There's no easy way of doing that without sending unnecessary packets, or considering latency. Also imagine this in a multi user environment and it soon becomes hard/impossible.
2 ints and a boolean for the mouse. I can see the keyboard processing being quite large though. Only way I can see around it would be bitmapping with the keys (sending a group of bytes that have their bits mapped to the key states, ie bit set is keydown, bit clear is keyup) but that would be a good 200 extra bits. If implemented it could be combined with the 2 major mouse buttons (each button having a bit set/clear to represent its state) but then there's the question of how much processing power would it take on java to assign all the bits on the fly. After all the server would have to query every single key, or at least get an object with the state of every single key then spend processing to shrink it into the bit flag notation.
It depends on the performance of Java really, and how LWGJL handles input getting. It's either that or force certain code to be managed by the client, which again would be a massive overhaul.
Ultimately I guess it will have to remain one of those 'dreamed of' features until then. Were I more familiar with Java I'd try to make a peripheral, but sadly I'm firmly rooted in the C-likes and me and Java don't currently get on very well.
*end of musings*