http://bugs.winehq.org/show_bug.cgi?id=35907
--- Comment #5 from Ken Thomases ken@codeweavers.com --- I suspect, but haven't yet confirmed with tests, that the change of thread keystate happens in sync with the message stream. That is, the keystate doesn't change until the thread pops all messages that were queued for it prior to the time when the Caps Lock key-press was sent.
So, this may require that, when the hardware message is queued for the destination thread, the wineserver also queue a fake version of the message into every other thread's queue, too. The fake message would never be returned from Get/PeekMessage(), but when it reaches the front of the queue, it would alter the keystate just like the real message does for the destination thread.