/[rdesktop]/sourceforge.net/trunk/rdesktop/xkeymap.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xkeymap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 170 by astrand, Tue Sep 17 08:18:41 2002 UTC revision 183 by astrand, Tue Sep 17 16:57:07 2002 UTC
# Line 25  Line 25 
25  #include <string.h>  #include <string.h>
26  #include <ctype.h>  #include <ctype.h>
27  #include <limits.h>  #include <limits.h>
28    #include <assert.h>
29  #include "rdesktop.h"  #include "rdesktop.h"
30  #include "scancodes.h"  #include "scancodes.h"
31    
# Line 362  ensure_remote_modifiers(uint32 ev_time, Line 363  ensure_remote_modifiers(uint32 ev_time,
363                          break;                          break;
364          }          }
365    
366          /* Shift */          /* Shift. Left shift and right shift are treated as equal; either is fine. */
367          if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)          if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
368              != MASK_HAS_BITS(remote_modifier_state, MapShiftMask))              != MASK_HAS_BITS(remote_modifier_state, MapShiftMask))
369          {          {
370                  /* The remote modifier state is not correct */                  /* The remote modifier state is not correct */
371                  if (MASK_HAS_BITS(tr.modifiers, MapShiftMask))                  if (MASK_HAS_BITS(tr.modifiers, MapLeftShiftMask))
372                  {                  {
373                          /* Needs this modifier. Send down. */                          /* Needs left shift. Send down. */
374                          rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LSHIFT);                          rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LSHIFT);
375                  }                  }
376                    else if (MASK_HAS_BITS(tr.modifiers, MapRightShiftMask))
377                    {
378                            /* Needs right shift. Send down. */
379                            rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_RSHIFT);
380                    }
381                  else                  else
382                  {                  {
383                          /* Should not use this modifier. Send up. */                          /* Should not use this modifier. Send up for shift currently pressed. */
384                          rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);                          if (MASK_HAS_BITS(remote_modifier_state, MapLeftShiftMask))
385                          rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);                                  /* Left shift is down */
386                                    rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
387                            else
388                            {
389                                    assert(MASK_HAS_BITS(remote_modifier_state, MapRightShiftMask));
390                                    /* Right shift is down */
391                                    rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
392                            }
393    
394                  }                  }
395          }          }
396    

Legend:
Removed from v.170  
changed lines
  Added in v.183

  ViewVC Help
Powered by ViewVC 1.1.26