Support for 9th mouse key (by Tolsi)

This commit is contained in:
def 2014-01-14 20:33:13 +01:00
parent 0d819aba4d
commit c90568ce71
4 changed files with 5 additions and 1 deletions

View file

@ -36,6 +36,7 @@ print >>f, "\tKEY_MOUSE_7 = %d,"%(highestid+7); keynames[highestid+7] = "mouse7"
print >>f, "\tKEY_MOUSE_8 = %d,"%(highestid+8); keynames[highestid+8] = "mouse8"
print >>f, "\tKEY_MOUSE_WHEEL_UP = %d,"%(highestid+9); keynames[highestid+9] = "mousewheelup"
print >>f, "\tKEY_MOUSE_WHEEL_DOWN = %d,"%(highestid+10); keynames[highestid+10] = "mousewheeldown"
print >>f, "\tKEY_MOUSE_9 = %d,"%(highestid+11); keynames[highestid+11] = "mouse9"
print >>f, "\tKEY_LAST,"
print >>f, "};"

View file

@ -144,6 +144,7 @@ int CInput::Update()
if(i&SDL_BUTTON(6)) m_aInputState[m_InputCurrent][KEY_MOUSE_6] = 1;
if(i&SDL_BUTTON(7)) m_aInputState[m_InputCurrent][KEY_MOUSE_7] = 1;
if(i&SDL_BUTTON(8)) m_aInputState[m_InputCurrent][KEY_MOUSE_8] = 1;
if(i&SDL_BUTTON(9)) m_aInputState[m_InputCurrent][KEY_MOUSE_9] = 1;
{
SDL_Event Event;
@ -186,6 +187,7 @@ int CInput::Update()
if(Event.button.button == 6) Key = KEY_MOUSE_6; // ignore_convention
if(Event.button.button == 7) Key = KEY_MOUSE_7; // ignore_convention
if(Event.button.button == 8) Key = KEY_MOUSE_8; // ignore_convention
if(Event.button.button == 9) Key = KEY_MOUSE_9; // ignore_convention
break;
// other messages

View file

@ -343,7 +343,7 @@ const char g_aaKeyStrings[512][16] =
"mouse8",
"mousewheelup",
"mousewheeldown",
"&333",
"mouse9",
"&334",
"&335",
"&336",

View file

@ -248,6 +248,7 @@ enum
KEY_MOUSE_8 = 330,
KEY_MOUSE_WHEEL_UP = 331,
KEY_MOUSE_WHEEL_DOWN = 332,
KEY_MOUSE_9 = 333,
KEY_LAST,
};