colormaps and keycodes

Dave DeBarr debarr "at"
Thu, 23 Jul 1998 21:12:38 +0000

At 02:46 PM 7/23/98 +0100, James [Wez] Weatherall wrote:
>On Thu, 23 Jul 1998, Dave DeBarr wrote:
>> In my case, I was running WinVNC 3.3.2 on NT with vncviewer 3.3.2 on
>> Solaris.  It seemed like WinVNC was ignoring the right shift key, so I
>> used the Microsoft Visual C++ debugger to check out what was happening. 
>> The right shift key was received from the viewer as "XK_Shift_R" (a good
>> thing); but just before the actual character would be dispatched, WinVNC
>> would set the left shift key to the down state and the right shift key
>> to the up state.
>What problem does this behaviour cause?
The right shift key was already in the down state when keybd_event() tried to place the left shift key into the down state.

>> As a temporary fix, I modified the keymap table on the
>> server side.  Since the "SetShiftState(VK_RSHIFT, FALSE);" statement
>> (for NT) renders the right shift key _almost_ useless, I changed line 52
>> of vncKeymap.cpp from... 
>> 	{VK_RSHIFT,		XK_Shift_R},
>> to...
>> 	{VK_LSHIFT,		XK_Shift_R},
>What difference does this make to WinVNC's behaviour?
Only the left shift key goes down.  Swapping vncKeymap.cpp lines 219 and 220 also works...
		SetShiftState(VK_LSHIFT, keymask & 1);
		SetShiftState(VK_RSHIFT, FALSE);
		SetShiftState(VK_RSHIFT, FALSE);
		SetShiftState(VK_LSHIFT, keymask & 1);

Dave DeBarr
MITRE; Room S4149, Mail Stop W548
11493 Sunset Hills Road; Reston, VA 20190
Voice (703) 883-6544; Fax (703) 883-3308

The VNC mailing list     -   see