diff options
Diffstat (limited to 'trunk/source/macro.h')
-rw-r--r-- | trunk/source/macro.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/trunk/source/macro.h b/trunk/source/macro.h index 9266ae3c26..dba3bafafe 100644 --- a/trunk/source/macro.h +++ b/trunk/source/macro.h @@ -21,7 +21,17 @@ #endif -int getchm(void); // keymaps applied (ie for prompts) +enum KeymapContext { + KC_DEFAULT, // For no-arg getchm(). + KC_LEVELMAP, // When in the 'X' level map + KC_TARGETING, // Only during 'x' and other targeting modes + + KC_CONTEXT_COUNT // Must always be the last +}; + +int getchm(int (*rgetch)() = NULL); // keymaps applied (ie for prompts) +int getchm(KeymapContext context, int (*rgetch)() = NULL); + int getch_with_command_macros(void); // keymaps and macros (ie for commands) void flush_input_buffer( int reason ); @@ -30,11 +40,24 @@ void macro_add_query(void); int macro_init(void); void macro_save(void); +void macro_userfn(const char *keys, const char *registryname); + +void macro_buf_add(int key); + +bool is_userfunction(int key); + +const char *get_userfunction(int key); + #endif #else #define getch_with_command_macros() getch() +#define getchm(x) getch() #define flush_input_buffer(XXX) ; +#define macro_buf_add(x) +#define is_userfunction(x) false +#define get_userfunction(x) NULL +#define call_userfunction(x) #endif |