/[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 113 by astrand, Wed Sep 11 07:39:53 2002 UTC revision 115 by astrand, Wed Sep 11 09:52:30 2002 UTC
# Line 41  static key_translation keymap[KEYMAP_SIZ Line 41  static key_translation keymap[KEYMAP_SIZ
41  static int min_keycode;  static int min_keycode;
42  static uint16 remote_modifier_state = 0;  static uint16 remote_modifier_state = 0;
43    
44    static void update_modifier_state(uint16 modifiers, BOOL pressed);
45    
46  static void  static void
47  add_to_keymap(char *keyname, uint8 scancode, uint16 modifiers, char *mapname)  add_to_keymap(char *keyname, uint8 scancode, uint16 modifiers, char *mapname)
48  {  {
# Line 307  inhibit_key(KeySym keysym) Line 309  inhibit_key(KeySym keysym)
309                  case XK_Multi_key:                  case XK_Multi_key:
310                          return True;                          return True;
311                          break;                          break;
312                    case XK_Num_Lock:
313                            return True;
314                            break;
315                  default:                  default:
316                          break;                          break;
317          }          }
# Line 372  ensure_remote_modifiers(uint32 ev_time, Line 377  ensure_remote_modifiers(uint32 ev_time,
377              != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask))              != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask))
378          {          {
379                  /* The remote modifier state is not correct */                  /* The remote modifier state is not correct */
380                  DEBUG_KBD(("Remote NumLock state is incorrect. Toggling\n"));                  uint16 new_remote_state = 0;
381    
382                  if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))                  if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))
383                  {                  {
384                          /* Needs this modifier. Toggle */                          DEBUG_KBD(("Remote NumLock state is incorrect, activating NumLock.\n"));
385                          rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_NUMLOCK);                          new_remote_state |= KBD_FLAG_NUMLOCK;
                         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_NUMLOCK);  
386                  }                  }
387                  else                  else
388                  {                  {
389                          /* Should not use this modifier. Toggle */                          DEBUG_KBD(("Remote NumLock state is incorrect, deactivating NumLock.\n"));
                         rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_NUMLOCK);  
                         rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_NUMLOCK);  
390                  }                  }
         }  
391    
392                    rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, new_remote_state, 0);
393                    update_modifier_state(SCANCODE_CHAR_NUMLOCK, True);
394            }
395  }  }
396    
397    

Legend:
Removed from v.113  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26