win32tty keystroke handling
- Move the code for keystroke handling into its own source file. - Compile and link it as a dynamic link library. - Dynamically load the keystroke handler at runtime - Add support for specifying a different handler in defaults.nh so that internationalization issues can be dealt with without rebuilding nethack, just supply alternative handlers in HACKDIR. The following exported functions need to be present in the keystroke handler .dll: ProcessKeystroke - returns an ascii value to NetHack NHkbhit - allows peeking to see if a key/mouse press is waiting SourceWhere - returns location for souce code for a keystroke handler SourceAuthor - returns author information for a keystroke handler KeyHandlerName - returns the full or short name of the keystroke handling dll.
This commit is contained in:
@@ -262,6 +262,10 @@ struct instance_flags {
|
||||
|
||||
boolean cmdassist; /* provide detailed assistance for some commands */
|
||||
boolean obsolete; /* obsolete options can point at this, it isn't used */
|
||||
#ifdef WIN32CON
|
||||
#define MAX_ALTKEYHANDLER 25
|
||||
char altkeyhandler[MAX_ALTKEYHANDLER];
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -133,6 +133,7 @@ extern void NDECL(win32_abort);
|
||||
extern void FDECL(nttty_preference_update, (const char *));
|
||||
extern void NDECL(toggle_mouse_support);
|
||||
extern void FDECL(map_subkeyvalue, (char *));
|
||||
extern void NDECL(load_keyboard_handler);
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
@@ -184,5 +185,11 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len);
|
||||
#endif
|
||||
|
||||
extern int FDECL(set_win32_option, (const char *, const char *));
|
||||
#ifdef WIN32CON
|
||||
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
|
||||
#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
|
||||
#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
|
||||
#define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
|
||||
#endif /* WIN32CON */
|
||||
|
||||
#endif /* NTCONF_H */
|
||||
|
||||
Reference in New Issue
Block a user