/[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 331 by astrand, Tue Feb 18 13:44:27 2003 UTC revision 449 by astrand, Wed Aug 27 09:42:55 2003 UTC
# Line 12  Line 12 
12     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.     GNU General Public License for more details.
15      
16     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */  */
20    
21    #ifdef RDP2VNC
22    #include "vnc/x11stubs.h"
23    #else
24  #include <X11/Xlib.h>  #include <X11/Xlib.h>
 #define XK_MISCELLANY  
25  #include <X11/keysym.h>  #include <X11/keysym.h>
26    #endif
27    
28  #include <ctype.h>  #include <ctype.h>
29  #include <limits.h>  #include <limits.h>
30  #include <time.h>  #include <time.h>
# Line 35  extern Display *display; Line 39  extern Display *display;
39  extern char keymapname[16];  extern char keymapname[16];
40  extern int keylayout;  extern int keylayout;
41  extern int win_button_size;  extern int win_button_size;
42  extern BOOL enable_compose;  extern BOOL g_enable_compose;
43    
44  static BOOL keymap_loaded;  static BOOL keymap_loaded;
45  static key_translation keymap[KEYMAP_SIZE];  static key_translation keymap[KEYMAP_SIZE];
46  static int min_keycode;  static int min_keycode;
47  static uint16 remote_modifier_state = 0;  static uint16 remote_modifier_state = 0;
48    static uint16 saved_remote_modifier_state = 0;
49    
50  static void update_modifier_state(uint8 scancode, BOOL pressed);  static void update_modifier_state(uint8 scancode, BOOL pressed);
51    
# Line 136  xkeymap_read(char *mapname) Line 141  xkeymap_read(char *mapname)
141                  if (strncmp(line, "enable_compose", 15) == 0)                  if (strncmp(line, "enable_compose", 15) == 0)
142                  {                  {
143                          DEBUG_KBD(("Enabling compose handling\n"));                          DEBUG_KBD(("Enabling compose handling\n"));
144                          enable_compose = True;                          g_enable_compose = True;
145                          continue;                          continue;
146                  }                  }
147    
# Line 355  xkeymap_translate_key(uint32 keysym, uns Line 360  xkeymap_translate_key(uint32 keysym, uns
360                  warning("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym));                  warning("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym));
361    
362          /* not in keymap, try to interpret the raw scancode */          /* not in keymap, try to interpret the raw scancode */
363          if ((keycode >= min_keycode) && (keycode <= 0x60))          if (((int) keycode >= min_keycode) && (keycode <= 0x60))
364          {          {
365                  tr.scancode = keycode - min_keycode;                  tr.scancode = keycode - min_keycode;
366    
# Line 410  get_ksname(uint32 keysym) Line 415  get_ksname(uint32 keysym)
415          return ksname;          return ksname;
416  }  }
417    
418    void
419    save_remote_modifiers()
420    {
421            saved_remote_modifier_state = remote_modifier_state;
422    }
423    
424    void
425    restore_remote_modifiers(uint32 ev_time)
426    {
427            key_translation dummy;
428    
429            dummy.scancode = 0;
430            dummy.modifiers = saved_remote_modifier_state;
431            ensure_remote_modifiers(ev_time, dummy);
432    }
433    
434  void  void
435  ensure_remote_modifiers(uint32 ev_time, key_translation tr)  ensure_remote_modifiers(uint32 ev_time, key_translation tr)

Legend:
Removed from v.331  
changed lines
  Added in v.449

  ViewVC Help
Powered by ViewVC 1.1.26