0

I am feeding the key from KeyUp()/KeyDown() in an applet to a Robot's KeyPress()/keyRelease() through UDP to "synchronize" the inputs of two users. However, the key codes appear to be mismatched - A "k" on the client end produces a "+" on the server end. Is there some way to convert between the two types?

Solved - I wasn't using a KeyListener, just native applet methods, so it wasn't using VK constants.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • What are you sending exactly? Do you have some sample code? – MadProgrammer Nov 12 '12 at 04:09
  • I sent the key code passed to KeyUp/Down as an int. The problem isn't that the number changes (it doesn't) but that the two sets of codes don't always correspond. – ForOhFor Error Nov 12 '12 at 05:21
  • The virtual keys shouldn't be different between the systems, as they are defined in the event. How are you converting the key code back to a char? – MadProgrammer Nov 12 '12 at 05:23
  • For better help sooner, post an [SSCCE](http://sscce.org/) (or perhaps more accurately, 2 SSCCEs - 1 of the applet, the other of the servlet ..whatever on the server side). – Andrew Thompson Nov 12 '12 at 09:15
  • Solved - I wasn't using a KeyListener, just native applet methods, so it wasn't using VK constants. – ForOhFor Error Nov 13 '12 at 15:17

0 Answers0