summaryrefslogtreecommitdiff
path: root/source/cl_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/cl_keys.c')
-rw-r--r--source/cl_keys.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/cl_keys.c b/source/cl_keys.c
index b415ada..116c2f0 100644
--- a/source/cl_keys.c
+++ b/source/cl_keys.c
@@ -375,7 +375,7 @@ void Key_SetBinding( int keynum, const char *binding ) {
keybindings[keynum] = Z_CopyString( binding );
}
-static const char *Key_Name_g( const char *partial, int state ) {
+static const char *Key_NameGenerator( const char *partial, int state ) {
static int length;
static keyname_t *k;
const char *name;
@@ -396,6 +396,20 @@ static const char *Key_Name_g( const char *partial, int state ) {
return NULL;
}
+static const char *Key_Bind_g( const char *partial, int argnum, int state ) {
+ if( argnum == 1 ) {
+ return Key_NameGenerator( partial, state );
+ }
+ return Prompt_Completer( partial, 2, argnum, state );
+}
+
+static const char *Key_Unbind_g( const char *partial, int argnum, int state ) {
+ if( argnum == 1 ) {
+ return Key_NameGenerator( partial, state );
+ }
+ return NULL;
+}
+
/*
===================
Key_Unbind_f
@@ -522,8 +536,8 @@ void Key_FillAPI( keyAPI_t *api ) {
}
static cmdreg_t c_keys[] = {
- { "bind", Key_Bind_f, Key_Name_g, Cmd_Mixed_g },
- { "unbind", Key_Unbind_f, Key_Name_g },
+ { "bind", Key_Bind_f, Key_Bind_g },
+ { "unbind", Key_Unbind_f, Key_Unbind_g },
{ "unbindall", Key_Unbindall_f },
{ "bindlist", Key_Bindlist_f },