git-svn-id: https://svn.eduke32.com/eduke32@811 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-06-29 11:59:43 +00:00
parent 9ea5b3febf
commit 586ad8bab4
2 changed files with 20 additions and 3 deletions

View file

@ -161,7 +161,9 @@ keydef keynames[]=
{"BACKSPACE", sc_BackSpace},
{"TAB", sc_Tab},
{"LEFTALT", sc_LeftAlt},
{"RIGHTALT", sc_RightAlt},
{"LEFTCONTROL", sc_LeftControl},
{"RIGHTCONTROL",sc_RightControl},
{"CAPSLOCK", sc_CapsLock},
{"LEFTSHIFT", sc_LeftShift},
{"RIGHTSHIFT", sc_RightShift},
@ -244,6 +246,12 @@ keydef keynames[]=
{"X", sc_X},
{"Y", sc_Y},
{"Z", sc_Z},
{"UPARROW", sc_UpArrow},
{"DOWNARROW", sc_DownArrow},
{"LEFTARROW", sc_LeftArrow},
{"RIGHTARROW", sc_RightArrow},
{0,0}
};

View file

@ -970,6 +970,7 @@ static int osdcmd_bind(const osdfuncparm_t *parm)
for (i=0;keynames[i].name;i++)OSD_Printf("%s\n",keynames[i].name);
return OSDCMD_OK;
}
if (parm->numparms==0)
{
OSD_Printf("Keybindings:\n");
@ -978,12 +979,17 @@ static int osdcmd_bind(const osdfuncparm_t *parm)
return OSDCMD_OK;
}
if (parm->numparms < 2) return OSDCMD_SHOWHELP;
for (i=0;keynames[i].name;i++)
if (!Bstrcasecmp(parm->parms[0],keynames[i].name))
break;
if (!keynames[i].name) return OSDCMD_SHOWHELP;
if (parm->numparms < 2)
{
OSD_Printf("%-11s = %s\n",keynames[i].name, boundkeys[keynames[i].id].name);
return OSDCMD_OK;
}
j = 1;
if (parm->numparms >= 2 && !Bstrcasecmp(parm->parms[j],"repeat"))
{
@ -999,7 +1005,7 @@ static int osdcmd_bind(const osdfuncparm_t *parm)
static int osdcmd_unbind(const osdfuncparm_t *parm)
{
int i, j;
int i;
if (parm->numparms==1&&!Bstrcasecmp(parm->parms[0],"all"))
{
@ -1079,8 +1085,11 @@ int registerosdcommands(void)
OSD_RegisterFunction("unbind","unbind <key>: unbinds a key. Type \"unbind all\" to unbind all keys.", osdcmd_unbind);
for (i=0;i<NUMGAMEFUNCTIONS;i++)
{
char *t;
Bsprintf(tempbuf,"gamefunc_%s",gamefunctions[i]);
OSD_RegisterFunction(Bstrdup(tempbuf),"game button",osdcmd_button);
t = Bstrdup(tempbuf);
Bstrcat(tempbuf,": game button");
OSD_RegisterFunction(t,Bstrdup(tempbuf),osdcmd_button);
}
//baselayer_onvideomodechange = onvideomodechange;