1 /* $MirOS: contrib/code/jupp/kbd.h,v 1.2 2008/05/13 13:08:23 tg Exp $ */
5 * (C) 1992 Joseph H. Allen
7 * This file is part of JOE (Joe's Own Editor)
15 /* KMAP *mkkmap(void);
16 * Create an empty keymap
18 KMAP *mkkmap PARAMS((void));
20 /* void rmkmap(KMAP *kmap);
23 void rmkmap PARAMS((KMAP *kmap));
25 /* int kadd(KMAP *kmap,char *seq,void *bind);
26 * Add a key sequence binding to a key map
28 * Returns 0 for success
29 * -1 for for invalid key sequence
31 * A valid key sequence is one or more keys seperated with spaces. A key
32 * is a single character or one of the following strings:
36 * ^@ - ^_ Control characters
38 * SP 32 (space character)
40 * UP, DOWN, LEFT, RIGHT,
41 * F0 - F10, DEL, INS, HOME,
42 * END, PGUP, PGDN termcap special characters
44 * In addition, the last key of a key sequence may be replaced with
45 * a range-fill of the form: <KEY> TO <KEY>
47 * So for example, if the sequence: ^K A TO Z
48 * is speicified, then the key sequences
49 * ^K A, ^K B, ^K C, ... ^K Z are all bound.
51 int kadd PARAMS((CAP *cap, KMAP *kmap, unsigned char *seq, void *bind));
53 /* void kcpy(KMAP *dest,KMAP *src);
54 * Copy all of the entries in the 'src' keymap into the 'dest' keymap
56 void kcpy PARAMS((KMAP *dest, KMAP *src));
58 /* int kdel(KMAP *kmap,char *seq);
59 * Delete a binding from a keymap
61 * Returns 0 for success
62 * -1 if the given key sequence was invalid
63 * 1 if the given key sequence did not exist
65 int kdel PARAMS((KMAP *kmap, unsigned char *seq));
67 /* KBD *mkkbd(KMAP *kmap);
68 Create a keyboard handler which uses the given keymap
70 KBD *mkkbd PARAMS((KMAP *kmap));
74 * Eliminate a keyboard handler
76 void rmkbd PARAMS((KBD *k));
78 /* void *dokey(KBD *kbd,int k);
79 Handle a key for a KBD:
81 Returns 0 for invalid or prefix keys
83 Returns binding for a completed key sequence
85 void *dokey PARAMS((KBD *kbd, int n));