Display hat switches properly.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2149 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Darren Salt 2009-04-28 16:02:54 +00:00
parent 73718b3733
commit ccd2f024b5

View File

@ -341,6 +341,13 @@ MA 02110-1301, USA.
desc=[NSString stringWithFormat: @"Stick %d axis %d",
stickNumber+1, thingNumber+1];
}
else if(thingNumber >= MAX_REAL_BUTTONS)
{
static const char dir[][6] = { "up", "right", "down", "left" };
desc=[NSString stringWithFormat: @"Stick %d hat %d %s",
stickNumber+1, (thingNumber - MAX_REAL_BUTTONS) / 4 + 1,
dir[thingNumber & 3]];
}
else
{
desc=[NSString stringWithFormat: @"Stick %d button %d",