/[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 82 by astrand, Tue Jul 30 07:18:48 2002 UTC revision 113 by astrand, Wed Sep 11 07:39:53 2002 UTC
# Line 53  add_to_keymap(char *keyname, uint8 scanc Line 53  add_to_keymap(char *keyname, uint8 scanc
53                  return;                  return;
54          }          }
55    
56          DEBUG_KBD("Adding translation, keysym=0x%x, scancode=0x%x, "          DEBUG_KBD(("Adding translation, keysym=0x%x, scancode=0x%x, "
57                    "modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers);                     "modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers));
58    
59          keymap[keysym & KEYMAP_MASK].scancode = scancode;          keymap[keysym & KEYMAP_MASK].scancode = scancode;
60          keymap[keysym & KEYMAP_MASK].modifiers = modifiers;          keymap[keysym & KEYMAP_MASK].modifiers = modifiers;
# Line 116  xkeymap_read(char *mapname) Line 116  xkeymap_read(char *mapname)
116                  if (strncmp(line, "map ", 4) == 0)                  if (strncmp(line, "map ", 4) == 0)
117                  {                  {
118                          keylayout = strtol(line + 4, NULL, 16);                          keylayout = strtol(line + 4, NULL, 16);
119                          DEBUG_KBD("Keylayout 0x%x\n", keylayout);                          DEBUG_KBD(("Keylayout 0x%x\n", keylayout));
120                          continue;                          continue;
121                  }                  }
122    
123                  /* compose */                  /* compose */
124                  if (strncmp(line, "enable_compose", 15) == 0)                  if (strncmp(line, "enable_compose", 15) == 0)
125                  {                  {
126                          DEBUG_KBD("Enabling compose handling\n");                          DEBUG_KBD(("Enabling compose handling\n"));
127                          enable_compose = True;                          enable_compose = True;
128                          continue;                          continue;
129                  }                  }
# Line 242  xkeymap_translate_key(KeySym keysym, uns Line 242  xkeymap_translate_key(KeySym keysym, uns
242          if (tr.scancode != 0)          if (tr.scancode != 0)
243          {          {
244                  DEBUG_KBD                  DEBUG_KBD
245                          ("Found key translation, scancode=0x%x, modifiers=0x%x\n",                          (("Found key translation, scancode=0x%x, modifiers=0x%x\n",
246                           tr.scancode, tr.modifiers);                            tr.scancode, tr.modifiers));
247                  return tr;                  return tr;
248          }          }
249    
250          printf("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym));          fprintf(stderr, "No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym));
251    
252          /* not in keymap, try to interpret the raw scancode */          /* not in keymap, try to interpret the raw scancode */
253          if ((keycode >= min_keycode) && (keycode <= 0x60))          if ((keycode >= min_keycode) && (keycode <= 0x60))
254          {          {
255                  tr.scancode = keycode - min_keycode;                  tr.scancode = keycode - min_keycode;
256                  printf("Sending guessed scancode 0x%x\n", tr.scancode);                  fprintf(stderr, "Sending guessed scancode 0x%x\n", tr.scancode);
257          }          }
258          else          else
259          {          {
260                  printf("No good guess for keycode 0x%x found\n", keycode);                  fprintf(stderr, "No good guess for keycode 0x%x found\n", keycode);
261          }          }
262    
263          return tr;          return tr;
# Line 372  ensure_remote_modifiers(uint32 ev_time, Line 372  ensure_remote_modifiers(uint32 ev_time,
372              != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask))              != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask))
373          {          {
374                  /* The remote modifier state is not correct */                  /* The remote modifier state is not correct */
375                  DEBUG_KBD("Remote NumLock state is incorrect. Toggling\n");                  DEBUG_KBD(("Remote NumLock state is incorrect. Toggling\n"));
376                  if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))                  if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))
377                  {                  {
378                          /* Needs this modifier. Toggle */                          /* Needs this modifier. Toggle */
# Line 393  ensure_remote_modifiers(uint32 ev_time, Line 393  ensure_remote_modifiers(uint32 ev_time,
393  static void  static void
394  update_modifier_state(uint16 modifiers, BOOL pressed)  update_modifier_state(uint16 modifiers, BOOL pressed)
395  {  {
396    #ifdef WITH_DEBUG_KBD
397            uint16 old_modifier_state;
398    
399            old_modifier_state = remote_modifier_state;
400    #endif
401    
         DEBUG_KBD("Before updating modifier_state:0x%x, pressed=0x%x\n",  
                   remote_modifier_state, pressed);  
402          switch (modifiers)          switch (modifiers)
403          {          {
404                  case SCANCODE_CHAR_LSHIFT:                  case SCANCODE_CHAR_LSHIFT:
# Line 436  update_modifier_state(uint16 modifiers, Line 439  update_modifier_state(uint16 modifiers,
439                          }                          }
440                          break;                          break;
441          }          }
442          DEBUG_KBD("After updating modifier_state:0x%x\n", remote_modifier_state);  
443    #ifdef WITH_DEBUG_KBD
444            if (old_modifier_state != remote_modifier_state)
445            {
446                    DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n",
447                               old_modifier_state, pressed));
448                    DEBUG_KBD(("After updating modifier_state:0x%x\n", remote_modifier_state));
449            }
450    #endif
451    
452  }  }
453    
# Line 448  rdp_send_scancode(uint32 time, uint16 fl Line 459  rdp_send_scancode(uint32 time, uint16 fl
459    
460          if (scancode & SCANCODE_EXTENDED)          if (scancode & SCANCODE_EXTENDED)
461          {          {
462                  DEBUG_KBD("Sending extended scancode=0x%x, flags=0x%x\n",                  DEBUG_KBD(("Sending extended scancode=0x%x, flags=0x%x\n",
463                            scancode & ~SCANCODE_EXTENDED, flags);                             scancode & ~SCANCODE_EXTENDED, flags));
464                  rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT,                  rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT,
465                                 scancode & ~SCANCODE_EXTENDED, 0);                                 scancode & ~SCANCODE_EXTENDED, 0);
466          }          }
467          else          else
468          {          {
469                  DEBUG_KBD("Sending scancode=0x%x, flags=0x%x\n", scancode, flags);                  DEBUG_KBD(("Sending scancode=0x%x, flags=0x%x\n", scancode, flags));
470                  rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0);                  rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0);
471          }          }
472  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26