Fix TI83 buttons to all have default mappings, but currently not remappable. Fix InputWidget to properly handle most every special key (converting from Windows naming to Slimdx naming)

This commit is contained in:
andres.delikat 2011-04-24 13:26:26 +00:00
parent b52ab78e16
commit f0636a86ef
2 changed files with 104 additions and 0 deletions

View File

@ -382,6 +382,34 @@
public string MULTIPLY;
public string DIVIDE;
public string CLEAR;
public string EXP;
public string DASH;
public string PARACLOSE;
public string TAN;
public string VARS;
public string PARAOPEN;
public string COS;
public string PRGM;
public string STAT;
public string COMMA;
public string SIN;
public string MATRIX;
public string X;
public string STO;
public string LN;
public string LOG;
public string SQUARED;
public string NEG1;
public string MATH;
public string ALPHA;
public string GRAPH;
public string TRACE;
public string ZOOM;
public string WINDOW;
public string Y;
public string SECOND;
public string MODE;
public string DEL;
public TI83ControllerTemplate() { }
public bool Enabled;
public TI83ControllerTemplate(bool defaults)
@ -411,6 +439,32 @@
MULTIPLY = "NumberPadStar";
DIVIDE = "NumberPadSlash";
CLEAR = "Escape";
EXP = "6";
DASH = "Minus";
PARACLOSE = "0";
PARAOPEN = "9";
TAN = "T";
VARS = "V";
COS = "C";
PRGM = "R";
STAT = "S";
MATRIX = "LeftBracket";
X = "X";
STO = "Insert";
LN = "L";
LOG = "O";
SQUARED = "2";
NEG1 = "1";
MATH = "M";
ALPHA = "A";
GRAPH = "G";
TRACE = "Home";
ZOOM = "Z";
WINDOW = "W";
Y = "Y";
SECOND = "Slash";
MODE = "BackSlash";
DEL = "Delete";
}
else
{
@ -437,6 +491,34 @@
MULTIPLY = "";
DIVIDE = "";
CLEAR = "";
EXP = "";
DASH = "";
PARACLOSE = "";
TAN = "";
VARS = "";
PARAOPEN = "";
COS = "";
PRGM = "";
STAT = "";
COMMA = "";
SIN = "";
MATRIX = "";
X = "";
STO = "";
LN = "";
LOG = "";
SQUARED = "";
NEG1 = "";
MATH = "";
ALPHA = "";
GRAPH = "";
TRACE = "";
ZOOM = "";
WINDOW = "";
Y = "";
SECOND = "";
MODE = "";
DEL = "";
}
}
}

View File

@ -85,6 +85,7 @@ namespace BizHawk.MultiClient
{
public override string ToString()
{
// Convert Windows key names to SlimDX key names
string str = "";
if((modifiers & Keys.Shift)!=0)
str += "LeftShift + ";
@ -93,6 +94,14 @@ namespace BizHawk.MultiClient
if ((modifiers & Keys.Alt) != 0)
str += "LeftAlt + ";
str += key.ToString();
if (str.Length == 2 && str == "Up")
str = "UpArrow";
if (str.Length == 4 && str == "Down")
str = "DownArrow";
if (str.Length == 4 && str == "Left")
str = "LeftArrow";
if (str.Length == 5 && str == "Right")
str = "RightArrow";
if (str.Length >= 6 && str.Substring(0, 6) == "NumPad")
str = str.Insert(3, "ber");
if (str.Length == 7 && str.Substring(0, 7) == "Decimal")
@ -105,11 +114,24 @@ namespace BizHawk.MultiClient
str = "NumberPadMinus";
if (str.Length == 3 && str.Substring(0, 3) == "Add")
str = "NumberPadPlus";
if (str.Length == 4 && str == "Oem5")
str = "BackSlash";
if (str.Length == 4 && str == "Oem6")
str = "RightBracket";
if (str.Length == 4 && str == "Next")
str = "PageDown";
if (str.Length == 11 && str == "OemQuestion")
str = "Slash";
if (str.Length == 8 && str == "Oemtilde")
str = "Grave";
if (str.Length > 3)
{
if (str.Substring(0, 3) == "Oem")
str = str.Substring(3, str.Length - 3);
}
//Oem Removed now removed from these but they still need conversion
if (str.Length == 12 && str.Substring(0, 12) == "OpenBrackets")
str = "LeftBracket";
return str;
}
public Keys key;