ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/keyboard.C
(Generate patch)

Comparing rxvt-unicode/src/keyboard.C (file contents):
Revision 1.17 by root, Mon Nov 28 19:35:04 2005 UTC vs.
Revision 1.20 by root, Fri Jan 6 01:16:58 2006 UTC

3 3
4#ifdef KEYSYM_RESOURCE 4#ifdef KEYSYM_RESOURCE
5 5
6#include <cstring> 6#include <cstring>
7 7
8#include "rxvtperl.h"
8#include "keyboard.h" 9#include "keyboard.h"
9#include "command.h" 10#include "command.h"
10 11
11/* an intro to the data structure: 12/* an intro to the data structure:
12 * 13 *
71 72
72static void 73static void
73output_string (rxvt_term *rt, const char *str) 74output_string (rxvt_term *rt, const char *str)
74{ 75{
75 if (strncmp (str, "command:", 8) == 0) 76 if (strncmp (str, "command:", 8) == 0)
76 rt->cmd_write ((unsigned char *)str + 8, strlen (str) - 8); 77 rt->cmd_write (str + 8, strlen (str) - 8);
78 else if (strncmp (str, "perl:", 5) == 0)
79 HOOK_INVOKE((rt, HOOK_KEYBOARD_COMMAND, DT_STRING, str + 5, DT_END));
77 else 80 else
78 rt->tt_write ((unsigned char *)str, strlen (str)); 81 rt->tt_write (str, strlen (str));
79} 82}
80 83
81static void 84static void
82output_string_meta8 (rxvt_term *rt, unsigned int state, char *buf, int buflen) 85output_string_meta8 (rxvt_term *rt, unsigned int state, char *buf, int buflen)
83{ 86{
90 *ch |= 0x80; 93 *ch |= 0x80;
91 } 94 }
92 else if (rt->meta_char == C0_ESC) /* escape prefix */ 95 else if (rt->meta_char == C0_ESC) /* escape prefix */
93#endif 96#endif
94 { 97 {
95 const unsigned char ch = C0_ESC; 98 const char ch = C0_ESC;
96 rt->tt_write (&ch, 1); 99 rt->tt_write (&ch, 1);
97 } 100 }
98 } 101 }
99 102
100 rt->tt_write ((unsigned char *) buf, buflen); 103 rt->tt_write (buf, buflen);
101} 104}
102 105
103static int 106static int
104format_keyrange_string (const char *str, int keysym_offset, char *buf, int bufsize) 107format_keyrange_string (const char *str, int keysym_offset, char *buf, int bufsize)
105{ 108{
189void 192void
190keyboard_manager::register_user_translation (KeySym keysym, unsigned int state, const char *trans) 193keyboard_manager::register_user_translation (KeySym keysym, unsigned int state, const char *trans)
191{ 194{
192 keysym_t *key = new keysym_t; 195 keysym_t *key = new keysym_t;
193 wchar_t *wc = rxvt_mbstowcs (trans); 196 wchar_t *wc = rxvt_mbstowcs (trans);
194 const char *translation = rxvt_wcstoutf8 (wc); 197 char *translation = rxvt_wcstoutf8 (wc);
195 free (wc); 198 free (wc);
196 199
197 if (key && translation) 200 if (key && translation)
198 { 201 {
199 key->keysym = keysym; 202 key->keysym = keysym;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines