1
キー入力を取得する必要があります。数字の1〜9のいずれかであれば、int値を取得します。 NumPad9が押された場合例えばnumpadキー入力をint値に変換する
が、私は時間のためにそれに取り組んできた値9.
を取得する必要があり、それを解決するために見えることはできません。ここで
は、私がこれまでにやっていることです:
class Input
{
private int[] Key = { 7, 8, 9, 4, 5, 6, 1, 2, 3 };
private Position[] Values;
public Input()
{
Values = new Position[9];
int index = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
Values[index++] = new Position(i, j);
}
public Position GetPos(int Key)
{
return Values[Key];
}
/*public Position ReadInput(KeyboardState Keyboard)
{
* Here is the function that I need to call, how can I check efficiently if one of the
* Numpads 1-9 is pressed?
* return GetPos(IntegerValue);
}*/
}
位置タイプがちょうど行とコルint型の値が含まれています。
また、1つのキーだけが押されているかどうかを確認する方法はありますか?
ルック](http://stackoverflow.com/questions/375316/xna-keyboard-text-input) –