Add key rebinding

This is a modified version of Jason Dorje Short's key rebinding
patch, and allows also binding special keys, such as the ones
used in getloc and getpos.

One of the ways to play NetHack on nethack.alt.org is via a HTML
terminal in browser. Unfortunately this means several ctrl-key
combinations cannot be entered, because the browser intercepts
those. Similar thing applies to some international keyboard layouts
on Windows. With this patch, the user can just rebind the command
to a key that works best for them.

I've tested this on Linux TTY, X11, and Windows TTY and GUI.
This commit is contained in:
Pasi Kallinen
2016-10-05 17:19:06 +03:00
parent d0783facdc
commit 680c8a542c
15 changed files with 1696 additions and 422 deletions

View File

@@ -5,17 +5,18 @@
#ifndef FUNC_TAB_H
#define FUNC_TAB_H
struct func_tab {
char f_char;
boolean can_if_buried;
int NDECL((*f_funct));
const char *f_text;
};
/* extended command flags */
#define IFBURIED 0x01 /* can do command when buried */
#define AUTOCOMPLETE 0x02 /* command autocompletes */
#define WIZMODECMD 0x04 /* wizard-mode command */
#define GENERALCMD 0x08 /* general command, does not take game time */
struct ext_func_tab {
uchar key;
const char *ef_txt, *ef_desc;
int NDECL((*ef_funct));
boolean can_if_buried;
int flags;
const char *f_text;
};
extern struct ext_func_tab extcmdlist[];