2011-01-11 02:55:51 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2011-05-08 00:06:43 +00:00
|
|
|
|
using System.Text;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient
|
|
|
|
|
{
|
|
|
|
|
public class Controller : IController
|
|
|
|
|
{
|
|
|
|
|
private ControllerDefinition type;
|
|
|
|
|
private Dictionary<string,List<string>> bindings = new Dictionary<string, List<string>>();
|
2011-01-14 03:38:26 +00:00
|
|
|
|
private Dictionary<string,bool> stickyButtons = new Dictionary<string, bool>();
|
2011-01-11 02:55:51 +00:00
|
|
|
|
private List<string> unpressedButtons = new List<string>();
|
2011-01-14 03:38:26 +00:00
|
|
|
|
private List<string> forcePressedButtons = new List<string>();
|
|
|
|
|
private List<string> removeFromForcePressedButtons = new List<string>();
|
2011-05-08 00:06:43 +00:00
|
|
|
|
private List<string> programmaticallyPressedButtons = new List<string>();
|
|
|
|
|
|
|
|
|
|
private bool movieMode;
|
|
|
|
|
public bool MovieMode
|
|
|
|
|
{
|
|
|
|
|
get { return movieMode; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
movieMode = value;
|
|
|
|
|
if (value == false)
|
|
|
|
|
programmaticallyPressedButtons.Clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
|
|
|
|
public Controller(ControllerDefinition definition)
|
|
|
|
|
{
|
|
|
|
|
type = definition;
|
|
|
|
|
|
|
|
|
|
foreach (var b in type.BoolButtons)
|
2011-01-14 03:38:26 +00:00
|
|
|
|
{
|
2011-01-11 02:55:51 +00:00
|
|
|
|
bindings[b] = new List<string>();
|
2011-01-14 03:38:26 +00:00
|
|
|
|
stickyButtons[b] = false;
|
|
|
|
|
}
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
|
|
|
|
foreach (var f in type.FloatControls)
|
|
|
|
|
bindings[f] = new List<string>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BindButton(string button, string control)
|
|
|
|
|
{
|
|
|
|
|
bindings[button].Add(control);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BindMulti(string button, string controlString)
|
|
|
|
|
{
|
2011-02-20 06:13:26 +00:00
|
|
|
|
if (string.IsNullOrEmpty(controlString))
|
|
|
|
|
return;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
string[] controlbindings = controlString.Split(',');
|
|
|
|
|
foreach (string control in controlbindings)
|
|
|
|
|
bindings[button].Add(control.Trim());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ControllerDefinition Type
|
|
|
|
|
{
|
|
|
|
|
get { return type; }
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-14 03:38:26 +00:00
|
|
|
|
public bool this[string button]
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-01-14 03:38:26 +00:00
|
|
|
|
get { return IsPressed(button); }
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-14 03:38:26 +00:00
|
|
|
|
public bool IsPressed(string button)
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-05-08 00:06:43 +00:00
|
|
|
|
if (MovieMode)
|
|
|
|
|
{
|
|
|
|
|
return programmaticallyPressedButtons.Contains(button);
|
|
|
|
|
}
|
2011-01-14 03:38:26 +00:00
|
|
|
|
if (forcePressedButtons.Contains(button))
|
|
|
|
|
{
|
|
|
|
|
removeFromForcePressedButtons.Add(button);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (unpressedButtons.Contains(button))
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-01-14 03:38:26 +00:00
|
|
|
|
if (IsPressedActually(button) == false)
|
|
|
|
|
unpressedButtons.Remove(button);
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-14 03:38:26 +00:00
|
|
|
|
return IsPressedActually(button);
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-14 03:38:26 +00:00
|
|
|
|
private bool IsPressedActually(string button)
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-01-14 03:38:26 +00:00
|
|
|
|
bool sticky = stickyButtons[button];
|
|
|
|
|
|
|
|
|
|
foreach (var control in bindings[button])
|
2011-01-11 02:55:51 +00:00
|
|
|
|
if (Input.IsPressed(control))
|
2011-01-14 03:38:26 +00:00
|
|
|
|
return sticky ? false : true;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
2011-01-14 03:38:26 +00:00
|
|
|
|
return sticky ? true : false;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float GetFloat(string name)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UnpressButton(string name)
|
|
|
|
|
{
|
|
|
|
|
unpressedButtons.Add(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int frameNumber;
|
2011-02-05 05:40:19 +00:00
|
|
|
|
|
|
|
|
|
public void UpdateControls(int frame)
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-02-05 05:40:19 +00:00
|
|
|
|
if (frame != frameNumber)
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2011-02-05 05:40:19 +00:00
|
|
|
|
// update
|
|
|
|
|
unpressedButtons.RemoveAll(button => IsPressedActually(button) == false);
|
|
|
|
|
forcePressedButtons.RemoveAll(button => removeFromForcePressedButtons.Contains(button));
|
|
|
|
|
removeFromForcePressedButtons.Clear();
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
2011-02-05 05:40:19 +00:00
|
|
|
|
frameNumber = frame;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
2011-01-14 03:38:26 +00:00
|
|
|
|
|
|
|
|
|
public void SetSticky(string button, bool sticky)
|
|
|
|
|
{
|
|
|
|
|
stickyButtons[button] = sticky;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsSticky(string button)
|
|
|
|
|
{
|
|
|
|
|
return stickyButtons[button];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ForceButton(string button)
|
|
|
|
|
{
|
|
|
|
|
forcePressedButtons.Add(button);
|
|
|
|
|
}
|
2011-05-08 00:06:43 +00:00
|
|
|
|
|
|
|
|
|
public string GetControllersAsMnemonic()
|
|
|
|
|
{
|
|
|
|
|
StringBuilder input = new StringBuilder("|");
|
|
|
|
|
|
|
|
|
|
if (type.Name == "SMS Controller")
|
|
|
|
|
{
|
|
|
|
|
input.Append(IsPressed("P1 Up") ? "U" : ".");
|
|
|
|
|
input.Append(IsPressed("P1 Down") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("P1 Left") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("P1 Right") ? "R" : ".");
|
|
|
|
|
input.Append(IsPressed("P1 B1") ? "1" : ".");
|
|
|
|
|
input.Append(IsPressed("P1 B2") ? "2" : ".");
|
|
|
|
|
input.Append("|");
|
|
|
|
|
input.Append(IsPressed("P2 Up") ? "U" : ".");
|
|
|
|
|
input.Append(IsPressed("P2 Down") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("P2 Left") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("P2 Right") ? "R" : ".");
|
|
|
|
|
input.Append(IsPressed("P2 B1") ? "1" : ".");
|
|
|
|
|
input.Append(IsPressed("P2 B2") ? "2" : ".");
|
|
|
|
|
input.Append("|");
|
|
|
|
|
input.Append(IsPressed("Pause") ? "P" : ".");
|
|
|
|
|
input.Append(IsPressed("Reset") ? "R" : ".");
|
|
|
|
|
return input.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.Name == "PC Engine Controller")
|
|
|
|
|
{
|
2011-05-18 23:53:19 +00:00
|
|
|
|
input.Append("."); //TODO: reset goes here
|
|
|
|
|
input.Append("|");
|
2011-05-14 00:15:31 +00:00
|
|
|
|
for (int i = 1; i < 6; i++)
|
|
|
|
|
{
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Up") ? "U" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Down") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Left") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Right") ? "R" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " B1") ? "1" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " B2") ? "2" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Run") ? "R" : ".");
|
|
|
|
|
input.Append(IsPressed("P" + i.ToString() + " Select") ? "S" : ".");
|
|
|
|
|
input.Append("|");
|
|
|
|
|
}
|
2011-05-08 00:06:43 +00:00
|
|
|
|
return input.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.Name == "NES Controls")
|
|
|
|
|
{
|
2011-05-08 20:55:37 +00:00
|
|
|
|
input.Append(IsPressed("Reset") ? "r" : ".");
|
|
|
|
|
input.Append("|");
|
2011-05-08 21:09:20 +00:00
|
|
|
|
input.Append(IsPressed("Right") ? "R" : ".");
|
|
|
|
|
input.Append(IsPressed("Left") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("Down") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("Up") ? "U" : ".");
|
2011-05-08 20:55:37 +00:00
|
|
|
|
input.Append(IsPressed("Start") ? "S" : ".");
|
2011-05-08 21:09:20 +00:00
|
|
|
|
input.Append(IsPressed("Select") ? "s" : ".");
|
|
|
|
|
input.Append(IsPressed("B") ? "B" : ".");
|
|
|
|
|
input.Append(IsPressed("A") ? "A" : ".");
|
2011-05-08 00:06:43 +00:00
|
|
|
|
input.Append("|");
|
|
|
|
|
return input.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-21 17:31:15 +00:00
|
|
|
|
if (type.Name == "TI83 Controls")
|
|
|
|
|
{
|
|
|
|
|
input.Append(IsPressed("0") ? "0" : ".");
|
|
|
|
|
input.Append(IsPressed("1") ? "1" : ".");
|
|
|
|
|
input.Append(IsPressed("2") ? "2" : ".");
|
|
|
|
|
input.Append(IsPressed("3") ? "3" : ".");
|
|
|
|
|
input.Append(IsPressed("4") ? "4" : ".");
|
|
|
|
|
input.Append(IsPressed("5") ? "5" : ".");
|
|
|
|
|
input.Append(IsPressed("6") ? "6" : ".");
|
|
|
|
|
input.Append(IsPressed("7") ? "7" : ".");
|
|
|
|
|
input.Append(IsPressed("8") ? "8" : ".");
|
|
|
|
|
input.Append(IsPressed("9") ? "9" : ".");
|
|
|
|
|
input.Append(IsPressed("DOT") ? "`" : ".");
|
|
|
|
|
input.Append(IsPressed("ON") ? "O" : ".");
|
|
|
|
|
input.Append(IsPressed("ENTER") ? "=" : ".");
|
|
|
|
|
input.Append(IsPressed("UP") ? "U" : ".");
|
|
|
|
|
input.Append(IsPressed("DOWN") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("LEFT") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("RIGHT") ? "R": ".");
|
|
|
|
|
input.Append(IsPressed("PLUS") ? "+": ".");
|
|
|
|
|
input.Append(IsPressed("MINUS") ? "_": ".");
|
|
|
|
|
input.Append(IsPressed("MULTIPLY") ? "*": ".");
|
|
|
|
|
input.Append(IsPressed("DIVIDE") ? "/": ".");
|
|
|
|
|
input.Append(IsPressed("CLEAR") ? "c": ".");
|
|
|
|
|
input.Append(IsPressed("EXP") ? "^": ".");
|
|
|
|
|
input.Append(IsPressed("DASH") ? "-": ".");
|
|
|
|
|
input.Append(IsPressed("PARAOPEN") ? "(" : ".");
|
|
|
|
|
input.Append(IsPressed("PARACLOSE") ? ")" : ".");
|
|
|
|
|
input.Append(IsPressed("TAN") ? "T" : ".");
|
|
|
|
|
input.Append(IsPressed("VARS") ? "V" : ".");
|
|
|
|
|
input.Append(IsPressed("COS") ? "C" : ".");
|
|
|
|
|
input.Append(IsPressed("PRGM") ? "P" : ".");
|
|
|
|
|
input.Append(IsPressed("STAT") ? "s" : ".");
|
|
|
|
|
input.Append(IsPressed("MATRIX") ? "m" : ".");
|
|
|
|
|
input.Append(IsPressed("X") ? "X" : ".");
|
|
|
|
|
input.Append(IsPressed("STO") ? ">" : ".");
|
|
|
|
|
input.Append(IsPressed("LN") ? "n" : ".");
|
|
|
|
|
input.Append(IsPressed("LOG") ? "L" : ".");
|
|
|
|
|
input.Append(IsPressed("SQUARED") ? "2" : ".");
|
|
|
|
|
input.Append(IsPressed("NEG1") ? "1" : ".");
|
|
|
|
|
input.Append(IsPressed("MATH") ? "H" : ".");
|
|
|
|
|
input.Append(IsPressed("ALPHA") ? "A" : ".");
|
|
|
|
|
input.Append(IsPressed("GRAPH") ? "G" : ".");
|
|
|
|
|
input.Append(IsPressed("TRACE") ? "t" : ".");
|
|
|
|
|
input.Append(IsPressed("ZOOM") ? "Z" : ".");
|
|
|
|
|
input.Append(IsPressed("WINDOW") ? "W" : ".");
|
|
|
|
|
input.Append(IsPressed("Y") ? "Y" : ".");
|
|
|
|
|
input.Append(IsPressed("2ND") ? "&" : ".");
|
|
|
|
|
input.Append(IsPressed("MODE") ? "O" : ".");
|
|
|
|
|
input.Append(IsPressed("DEL") ? "D" : ".");
|
|
|
|
|
input.Append(IsPressed("COMMA") ? "," : ".");
|
|
|
|
|
input.Append(IsPressed("SIN") ? "S" : ".");
|
|
|
|
|
input.Append("|.|"); //TODO: perhaps ON should go here?
|
|
|
|
|
return input.ToString();
|
|
|
|
|
}
|
2011-05-08 00:06:43 +00:00
|
|
|
|
return "?";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetControllersAsMnemonic(string mnemonic)
|
|
|
|
|
{
|
|
|
|
|
MovieMode = true;
|
|
|
|
|
programmaticallyPressedButtons.Clear();
|
|
|
|
|
|
|
|
|
|
if (type.Name == "SMS Controller")
|
|
|
|
|
{
|
2011-05-14 00:15:31 +00:00
|
|
|
|
for (int i = 1; i < 3; i++)
|
|
|
|
|
{
|
2011-05-21 17:31:15 +00:00
|
|
|
|
if (mnemonic.Length < (1 + 7 * i)) return;
|
2011-05-17 01:10:04 +00:00
|
|
|
|
//if (mnemonic[1] != '.' && mnemonic[1] != '0') programmaticallyPressedButtons.Add("Reset");
|
2011-05-21 17:31:15 +00:00
|
|
|
|
if (mnemonic[(i - 1) * 7 + 3] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Up");
|
2011-05-14 00:15:31 +00:00
|
|
|
|
if (mnemonic[(i - 1) * 7 + 4] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Down");
|
|
|
|
|
if (mnemonic[(i - 1) * 7 + 5] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Left");
|
|
|
|
|
if (mnemonic[(i - 1) * 7 + 6] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Right");
|
|
|
|
|
if (mnemonic[(i - 1) * 7 + 7] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " B1");
|
|
|
|
|
if (mnemonic[(i - 1) * 7 + 8] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " B2");
|
|
|
|
|
}
|
2011-05-12 18:28:38 +00:00
|
|
|
|
if (mnemonic.Length < 18) return;
|
|
|
|
|
if (mnemonic[17] != '.') programmaticallyPressedButtons.Add("Pause");
|
|
|
|
|
if (mnemonic[18] != '.') programmaticallyPressedButtons.Add("Reset");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.Name == "PC Engine Controller")
|
|
|
|
|
{
|
2011-05-14 00:15:31 +00:00
|
|
|
|
for (int i = 1; i < 6; i++)
|
|
|
|
|
{
|
|
|
|
|
if (mnemonic.Length < (1 + i * 9)) return;
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Up");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Down");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Left");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Right");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " B1");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " B2");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Run");
|
|
|
|
|
if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i.ToString() + " Select");
|
|
|
|
|
}
|
2011-05-08 00:06:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.Name == "NES Controls")
|
|
|
|
|
{
|
2011-05-12 18:28:38 +00:00
|
|
|
|
if (mnemonic.Length < 10) return;
|
2011-05-17 01:10:04 +00:00
|
|
|
|
//if (mnemonic[1] != '.' && mnemonic[1] != '0') programmaticallyPressedButtons.Add("Reset");
|
2011-05-08 20:55:37 +00:00
|
|
|
|
if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("Right");
|
|
|
|
|
if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("Left");
|
|
|
|
|
if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("Down");
|
|
|
|
|
if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("Up");
|
|
|
|
|
if (mnemonic[7] != '.') programmaticallyPressedButtons.Add("Start");
|
|
|
|
|
if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("Select");
|
|
|
|
|
if (mnemonic[9] != '.') programmaticallyPressedButtons.Add("B");
|
|
|
|
|
if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("A");
|
2011-05-08 00:06:43 +00:00
|
|
|
|
}
|
2011-05-21 17:31:15 +00:00
|
|
|
|
|
|
|
|
|
if (type.Name == "TI83 Controls") ;
|
|
|
|
|
{
|
|
|
|
|
if (mnemonic.Length < 50) return;
|
|
|
|
|
|
|
|
|
|
if (mnemonic[1] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("0");
|
|
|
|
|
if (mnemonic[2] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("1");
|
|
|
|
|
if (mnemonic[3] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("2");
|
|
|
|
|
if (mnemonic[4] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("3");
|
|
|
|
|
if (mnemonic[5] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("4");
|
|
|
|
|
if (mnemonic[6] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("5");
|
|
|
|
|
if (mnemonic[7] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("6");
|
|
|
|
|
if (mnemonic[8] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("7");
|
|
|
|
|
if (mnemonic[9] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("8");
|
|
|
|
|
if (mnemonic[10] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("9");
|
|
|
|
|
if (mnemonic[11] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("DOT");
|
|
|
|
|
if (mnemonic[12] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("ON");
|
|
|
|
|
if (mnemonic[13] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("ENTER");
|
|
|
|
|
if (mnemonic[14] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("UP");
|
|
|
|
|
if (mnemonic[15] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("DOWN");
|
|
|
|
|
if (mnemonic[16] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("LEFT");
|
|
|
|
|
if (mnemonic[17] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("RIGHT");
|
|
|
|
|
if (mnemonic[18] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("PLUS");
|
|
|
|
|
if (mnemonic[19] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("MINUS");
|
|
|
|
|
if (mnemonic[20] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("MULTIPLY");
|
|
|
|
|
if (mnemonic[21] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("DIVIDE");
|
|
|
|
|
if (mnemonic[22] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("CLEAR");
|
|
|
|
|
if (mnemonic[23] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("EXP");
|
|
|
|
|
if (mnemonic[24] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("DASH");
|
|
|
|
|
if (mnemonic[25] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("PARAOPEN");
|
|
|
|
|
if (mnemonic[26] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("PARACLOSE");
|
|
|
|
|
if (mnemonic[27] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("TAN");
|
|
|
|
|
if (mnemonic[28] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("VARS");
|
|
|
|
|
if (mnemonic[29] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("COS");
|
|
|
|
|
if (mnemonic[30] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("PGRM");
|
|
|
|
|
if (mnemonic[31] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("STAT");
|
|
|
|
|
if (mnemonic[32] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("MATRIX");
|
|
|
|
|
if (mnemonic[33] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("X");
|
|
|
|
|
if (mnemonic[34] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("STO");
|
|
|
|
|
if (mnemonic[35] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("LN");
|
|
|
|
|
if (mnemonic[36] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("LOG");
|
|
|
|
|
if (mnemonic[37] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("SQUARED");
|
|
|
|
|
if (mnemonic[38] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("NEG");
|
|
|
|
|
if (mnemonic[39] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("MATH");
|
|
|
|
|
if (mnemonic[40] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("ALPHA");
|
|
|
|
|
if (mnemonic[41] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("GRAPH");
|
|
|
|
|
if (mnemonic[42] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("TRACE");
|
|
|
|
|
if (mnemonic[43] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("ZOOM");
|
|
|
|
|
if (mnemonic[44] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("WINDOW");
|
|
|
|
|
if (mnemonic[45] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("Y");
|
|
|
|
|
if (mnemonic[46] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("2ND");
|
|
|
|
|
if (mnemonic[47] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("MODE");
|
|
|
|
|
if (mnemonic[48] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("DEL");
|
|
|
|
|
if (mnemonic[49] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("COMMA");
|
|
|
|
|
if (mnemonic[50] != '.')
|
|
|
|
|
programmaticallyPressedButtons.Add("SIN");
|
|
|
|
|
}
|
2011-05-08 00:06:43 +00:00
|
|
|
|
}
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
2011-01-14 03:38:26 +00:00
|
|
|
|
}
|