| 1 | /* |
| 2 | Rebindable key mappings. |
| 3 | */ |
| 4 | |
| 5 | #include "sexpr/sexp.h" |
| 6 | |
| 7 | typedef int (*oesbind_t)(int val); /* OES game bind type - function pointer to a function that takes one integer parameter. */ |
| 8 | |
| 9 | #define OESKEYMAPSIZE 512 |
| 10 | typedef oesbind_t oeskeymap_t[OESKEYMAPSIZE]; |
| 11 | |
| 12 | /* game binding names (from config file) */ |
| 13 | struct oes_xlat_t { |
| 14 | const char *symbol; |
| 15 | oesbind_t binding; |
| 16 | }; |
| 17 | |
| 18 | typedef struct oes_xlat_t oes_xlat_t; |
| 19 | |
| 20 | |
| 21 | |
| 22 | oeskeymap_t *oeskeymap_init (oeskeymap_t *); |
| 23 | int oeskeymap_set (oeskeymap_t *, int, oesbind_t, float scale); |
| 24 | oesbind_t oeskeymap_get (oeskeymap_t *, int); |
| 25 | int oeskeymap_load (oeskeymap_t *, const char *bindfile); |
| 26 | int oeskeymap_resolve (const char *); |
| 27 | const char * oeskeymap_lookup (int); |
| 28 | |
| 29 | |
| 30 | /* Globals. */ |
| 31 | extern oeskeymap_t oeskeymap; /* keymap. function binding to key. */ |
| 32 | extern oes_xlat_t oesxlat[]; /* translate function name to function pointer. */ |