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.71 by sf-exg, Thu Jan 15 14:30:04 2015 UTC vs.
Revision 1.72 by sf-exg, Tue Mar 17 09:23:08 2015 UTC

132 132
133 keymap.push_back (key); 133 keymap.push_back (key);
134 hash[0] = 3; 134 hash[0] = 3;
135} 135}
136 136
137bool 137keysym_t *
138keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state, const char *kbuf, int len) 138keyboard_manager::lookup_keysym (rxvt_term *term, KeySym keysym, unsigned int state)
139{ 139{
140 assert (("register_done() need to be called", hash[0] == 0)); 140 assert (("register_done() need to be called", hash[0] == 0));
141 141
142 state &= OtherModMask; // mask out uninteresting modifiers 142 state &= OtherModMask; // mask out uninteresting modifiers
143 143
148 if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) 148 if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask))
149 state |= AppKeypadMask; 149 state |= AppKeypadMask;
150 150
151 int index = find_keysym (keysym, state); 151 int index = find_keysym (keysym, state);
152 152
153 if (index >= 0) 153 return index >= 0 ? keymap [index] : 0;
154 { 154}
155 keysym_t *key = keymap [index];
156 155
156bool
157keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state, const char *kbuf, int len)
158{
159 keysym_t *key = lookup_keysym (term, keysym, state);
160
161 if (key)
162 {
157 if (key->type == keysym_t::BUILTIN_STRING) 163 if (key->type == keysym_t::BUILTIN_STRING)
158 { 164 {
159 term->tt_write_user_input (kbuf, len); 165 term->tt_write_user_input (kbuf, len);
160 return true; 166 return true;
161 } 167 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines