/[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 962 by astrand, Wed Aug 3 09:56:17 2005 UTC revision 973 by astrand, Thu Aug 4 12:44:10 2005 UTC
# Line 1  Line 1 
1  /*  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     User interface services - X keyboard mapping     User interface services - X keyboard mapping
4    
# Line 42  extern Display *g_display; Line 42  extern Display *g_display;
42  extern Window g_wnd;  extern Window g_wnd;
43  extern char keymapname[16];  extern char keymapname[16];
44  extern int g_keylayout;  extern int g_keylayout;
45    extern int g_keyboard_type;
46    extern int g_keyboard_subtype;
47    extern int g_keyboard_functionkeys;
48  extern int g_win_button_size;  extern int g_win_button_size;
49  extern BOOL g_enable_compose;  extern BOOL g_enable_compose;
50  extern BOOL g_use_rdp5;  extern BOOL g_use_rdp5;
# Line 156  add_sequence(char *rest, char *mapname) Line 159  add_sequence(char *rest, char *mapname)
159          DEBUG_KBD(("\n"));          DEBUG_KBD(("\n"));
160  }  }
161    
162  void  BOOL
163  xkeymap_from_locale(const char *locale)  xkeymap_from_locale(const char *locale)
164  {  {
165          char *str, *ptr;          char *str, *ptr;
# Line 208  xkeymap_from_locale(const char *locale) Line 211  xkeymap_from_locale(const char *locale)
211          {          {
212                  fclose(fp);                  fclose(fp);
213                  STRNCPY(keymapname, str, sizeof(keymapname));                  STRNCPY(keymapname, str, sizeof(keymapname));
214                  fprintf(stderr, "Autoselected keyboard map %s.\n", keymapname);                  return True;
215          }          }
216    
217            return False;
218  }  }
219    
220    
# Line 311  xkeymap_read(char *mapname) Line 316  xkeymap_read(char *mapname)
316                  }                  }
317    
318                  /* Include */                  /* Include */
319                  if (strncmp(line, "include ", 8) == 0)                  if (strncmp(line, "include ", sizeof("include ") - 1) == 0)
320                  {                  {
321                          if (!xkeymap_read(line + 8))                          if (!xkeymap_read(line + sizeof("include ") - 1))
322                                  return False;                                  return False;
323                          continue;                          continue;
324                  }                  }
325    
326                  /* map */                  /* map */
327                  if (strncmp(line, "map ", 4) == 0)                  if (strncmp(line, "map ", sizeof("map ") - 1) == 0)
328                  {                  {
329                          g_keylayout = strtol(line + 4, NULL, 16);                          g_keylayout = strtol(line + sizeof("map ") - 1, NULL, 16);
330                          DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout));                          DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout));
331                          continue;                          continue;
332                  }                  }
333    
334                  /* compose */                  /* compose */
335                  if (strncmp(line, "enable_compose", 15) == 0)                  if (strncmp(line, "enable_compose", sizeof("enable_compose") - 1) == 0)
336                  {                  {
337                          DEBUG_KBD(("Enabling compose handling\n"));                          DEBUG_KBD(("Enabling compose handling\n"));
338                          g_enable_compose = True;                          g_enable_compose = True;
# Line 335  xkeymap_read(char *mapname) Line 340  xkeymap_read(char *mapname)
340                  }                  }
341    
342                  /* sequence */                  /* sequence */
343                  if (strncmp(line, "sequence", 8) == 0)                  if (strncmp(line, "sequence", sizeof("sequence") - 1) == 0)
344                    {
345                            add_sequence(line + sizeof("sequence") - 1, mapname);
346                            continue;
347                    }
348    
349                    /* keyboard_type */
350                    if (strncmp(line, "keyboard_type ", sizeof("keyboard_type ") - 1) == 0)
351                    {
352                            g_keyboard_type = strtol(line + sizeof("keyboard_type ") - 1, NULL, 16);
353                            DEBUG_KBD(("keyboard_type 0x%x\n", g_keyboard_type));
354                            continue;
355                    }
356    
357                    /* keyboard_subtype */
358                    if (strncmp(line, "keyboard_subtype ", sizeof("keyboard_subtype ") - 1) == 0)
359                    {
360                            g_keyboard_subtype =
361                                    strtol(line + sizeof("keyboard_subtype ") - 1, NULL, 16);
362                            DEBUG_KBD(("keyboard_subtype 0x%x\n", g_keyboard_subtype));
363                            continue;
364                    }
365    
366                    /* keyboard_functionkeys */
367                    if (strncmp(line, "keyboard_functionkeys ", sizeof("keyboard_functionkeys ") - 1) ==
368                        0)
369                  {                  {
370                          add_sequence(line + 8, mapname);                          g_keyboard_functionkeys =
371                                    strtol(line + sizeof("keyboard_functionkeys ") - 1, NULL, 16);
372                            DEBUG_KBD(("keyboard_functionkeys 0x%x\n", g_keyboard_functionkeys));
373                          continue;                          continue;
374                  }                  }
375    

Legend:
Removed from v.962  
changed lines
  Added in v.973

  ViewVC Help
Powered by ViewVC 1.1.26