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.54 by sf-exg, Sat Dec 3 11:31:56 2011 UTC vs.
Revision 1.55 by sf-exg, Sat Dec 3 11:47:19 2011 UTC

112{ 112{
113 char *translation = rxvt_wcstoutf8 (ws); 113 char *translation = rxvt_wcstoutf8 (ws);
114 114
115 keysym_t *key = new keysym_t; 115 keysym_t *key = new keysym_t;
116 116
117 if (key && translation) 117 if (!key)
118 {
119 key->keysym = keysym;
120 key->state = state;
121 key->str = translation;
122 key->type = keysym_t::STRING;
123
124 if (strncmp (translation, "builtin:", 8) == 0)
125 key->type = keysym_t::BUILTIN;
126
127 if (keymap.size () == keymap.capacity ())
128 keymap.reserve (keymap.size () * 2);
129
130 keymap.push_back (key);
131 hash[0] = 3;
132 }
133 else
134 {
135 delete key;
136 free (translation);
137 rxvt_fatal ("memory allocation failure. aborting.\n"); 118 rxvt_fatal ("memory allocation failure. aborting.\n");
138 } 119
120 key->keysym = keysym;
121 key->state = state;
122 key->str = translation;
123 key->type = keysym_t::STRING;
124
125 if (strncmp (translation, "builtin:", 8) == 0)
126 key->type = keysym_t::BUILTIN;
127
128 if (keymap.size () == keymap.capacity ())
129 keymap.reserve (keymap.size () * 2);
130
131 keymap.push_back (key);
132 hash[0] = 3;
139} 133}
140 134
141bool 135bool
142keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state) 136keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state)
143{ 137{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines