Changes in keymap.c [cf83b7a:428834d]
Legend:
- Unmodified
- Added
- Removed
-
keymap.c
rcf83b7a r428834d 5 5 6 6 /* returns 0 on success */ 7 int owl_keymap_init(owl_keymap *km, char *name, char *desc, void (*default_fn)( int), void (*prealways_fn)(int), void (*postalways_fn)(int))7 int owl_keymap_init(owl_keymap *km, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input)) 8 8 { 9 9 if (!name || !desc) return(-1); … … 151 151 } 152 152 153 owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, char *name, char *desc, void (*default_fn)( int), void (*prealways_fn)(int), void (*postalways_fn)(int))153 owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input)) 154 154 { 155 155 owl_keymap *km; … … 202 202 /* processes a keypress. returns 0 if the keypress was handled, 203 203 * 1 if not handled, -1 on error, and -2 if j==ERR. */ 204 int owl_keyhandler_process(owl_keyhandler *kh, int j)204 int owl_keyhandler_process(owl_keyhandler *kh, owl_input j) 205 205 { 206 206 owl_keymap *km; … … 214 214 215 215 /* temporarily disallow C-`/C-SPACE until we fix associated bugs */ 216 if (j ==ERR || j==0) {216 if (j.ch == ERR || j.ch == 0) { 217 217 return(-1); 218 218 } … … 224 224 225 225 /* deal with ESC prefixing */ 226 if (!kh->in_esc && j ==27) {226 if (!kh->in_esc && j.ch == 27) { 227 227 kh->in_esc = 1; 228 228 return(0); 229 229 } 230 230 if (kh->in_esc) { 231 j = OWL_META(j);231 j.ch = OWL_META(j.ch); 232 232 kh->in_esc = 0; 233 233 } 234 234 235 kh->kpstack[++(kh->kpstackpos)] = j ;235 kh->kpstack[++(kh->kpstackpos)] = j.ch; 236 236 if (kh->kpstackpos >= OWL_KEYMAP_MAXSTACK) { 237 237 owl_keyhandler_reset(kh); … … 260 260 } else if (match == 2) { /* exact match */ 261 261 /* owl_function_debugmsg("processkey: found exact match in %s", km->name); */ 262 owl_keybinding_execute(kb, j );262 owl_keybinding_execute(kb, j.ch); 263 263 owl_keyhandler_reset(kh); 264 264 if (km->postalways_fn) {
Note: See TracChangeset
for help on using the changeset viewer.