public static string Key_IsDown(uint ClientNum) //button monitoring DESCRIPTION
{
byte[] But = new byte[3];
PS3.GetMemory(0x110D5E1 + (0x3980 * ClientNum), ref But);
string mystring = null;
mystring = BitConverter.ToString(But);
string result = mystring.Replace("-", "");
string result1 = result.Replace(" ", "");
string key = result1;
string KeyPressed = "";
if (key == "000000")
{
KeyPressed = "NONE";
}
else if (key == "000400")
{
KeyPressed = "X";
}
else if (key == "000020")
{
KeyPressed = "[ ]";
}
else if (key == "000200")
{
KeyPressed = "Crouch";
}
else if (key == "000100")
{
KeyPressed = "Prone";
}
else if (key == "000400")
{
KeyPressed = "X";
}
else if (key == "000004")
{
KeyPressed = "R3";
}
else if (key == "002002")
{
KeyPressed = "L3";
}
else if (key == "004000")
{
KeyPressed = "R2";
}
else if (key == "008000")
{
KeyPressed = "L2";
}
else if (key == "080800")
{
KeyPressed = "L1";
}
else if (key == "000001")
{
KeyPressed = "R1";
}
else if (key == "002006")
{
KeyPressed = "R3 + L3";
}
else if (key == "000204")
{
KeyPressed = "R3";
}
else if (key == "002202")
{
KeyPressed = "L3";
}
else if (key == "004200")
{
KeyPressed = "R2";
}
else if (key == "008200")
{
KeyPressed = "L2";
}
else if (key == "00C100")
{
KeyPressed = "Prone + R2 + L2";
}
else if (key == "00C000")
{
KeyPressed = "R2 + L2";
}
else
{
KeyPressed = key;
}
return KeyPressed;
}
{
byte[] But = new byte[3];
PS3.GetMemory(0x110D5E1 + (0x3980 * ClientNum), ref But);
string mystring = null;
mystring = BitConverter.ToString(But);
string result = mystring.Replace("-", "");
string result1 = result.Replace(" ", "");
string key = result1;
string KeyPressed = "";
if (key == "000000")
{
KeyPressed = "NONE";
}
else if (key == "000400")
{
KeyPressed = "X";
}
else if (key == "000020")
{
KeyPressed = "[ ]";
}
else if (key == "000200")
{
KeyPressed = "Crouch";
}
else if (key == "000100")
{
KeyPressed = "Prone";
}
else if (key == "000400")
{
KeyPressed = "X";
}
else if (key == "000004")
{
KeyPressed = "R3";
}
else if (key == "002002")
{
KeyPressed = "L3";
}
else if (key == "004000")
{
KeyPressed = "R2";
}
else if (key == "008000")
{
KeyPressed = "L2";
}
else if (key == "080800")
{
KeyPressed = "L1";
}
else if (key == "000001")
{
KeyPressed = "R1";
}
else if (key == "002006")
{
KeyPressed = "R3 + L3";
}
else if (key == "000204")
{
KeyPressed = "R3";
}
else if (key == "002202")
{
KeyPressed = "L3";
}
else if (key == "004200")
{
KeyPressed = "R2";
}
else if (key == "008200")
{
KeyPressed = "L2";
}
else if (key == "00C100")
{
KeyPressed = "Prone + R2 + L2";
}
else if (key == "00C000")
{
KeyPressed = "R2 + L2";
}
else
{
KeyPressed = key;
}
return KeyPressed;
}
Credits :
BadLuckBrian