Allow binding mouse buttons

Instead of hardcoding mouse button actions, allow the user to
bind mouse buttons to extended commands.  For example the new
defaults are:

BIND=mouse1:therecmdmenu
BIND=mouse2:clicklook

Currently a bit rudimentary; the defaults should be OK, but
documentation is bit lacking, and in-game binding and option
saving are missing.

Allowed commands to bind are "nothing", "therecmdmenu", "clicklook",
and "mouseaction". Clicklook replaces the "clicklook" boolean option,
and mouseaction does what mouse 1 button used to do - a context sensitive
action.
This commit is contained in:
Pasi Kallinen
2022-08-23 23:06:26 +03:00
parent 3a255e86c4
commit c42e73fd9c
11 changed files with 135 additions and 78 deletions

View File

@@ -506,6 +506,7 @@ struct cmd {
const char *dirchars; /* current movement/direction characters */
const char *alphadirchars; /* same as dirchars if !numpad */
const struct ext_func_tab *commands[256]; /* indexed by input character */
const struct ext_func_tab *mousebtn[NUM_MOUSE_BUTTONS];
char spkeys[NUM_NHKF];
char extcmd_char; /* key that starts an extended command ('#') */
};