文字を入力すると、上部に宣言した現在の時刻が表示されますが、一定の時間が宣言された後、文字がロックされていないため、機能しません。
たとえば、5 秒後に p から Q に移動し、p に移動してから (テキスト ボックスに文字を保存)、再び p に移動して、単語を作成できるようにします。
ここに私のコードがあります:
namespace MiniKeyboardAssignment
{
public partial class Form1 : Form
{
//How long i've set my interval to go for, this means how long my timer will be on for before the current letter is saved//
int timerinterval = 2000;
bool button_but1 = true;
int Button1_clicked = -1;
bool button_but2 = true;
int Button2_clicked = -1;
bool button_but3 = true;
int Button3_clicked = -1;
bool button_but4 = true;
int Button4_clicked = -1;
bool button_but5 = true;
int Button5_Clicked = -1;
bool button_but6 = true;
int Button6_clicked = -1;
bool button_but7 = true;
int Button7_clicked = -1;
bool button_but8 = true;
int Button8_clicked = -1;
bool button_but9 = true;
int Button9_clicked = -1;
bool button_but10 = true;
int Button10_clicked = -1;
bool button_but12 = true;
int Button12_clicked = -1;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Mode_TextBox.Text = "Multipress";
}
private void timer1_Tick(object sender, EventArgs e)
{
counter = Convert.ToInt16(textBox1.Text);
counter++;
textBox1.Text = Convert.ToString(counter);
timer1.Enabled = true;
}
private void Button1_Click(object sender, EventArgs e)
{
string sequence1 = "1";
if (button_but1 == true)
{
Button1_clicked++;
textbox.Text = Convert.ToString(ListBox1.Items[Button1_clicked]);
listBox11.Items.Add(sequence1);
counter++;
textBox1.Text = Convert.ToString(counter);
button_but1 = false;
timer1.Enabled = true;
}
else
{
Button1_clicked++;
}
characterstring[Convert.ToInt16(textBox1.Text)] = Convert.ToString(ListBox1.Items[Button1_clicked]);
textbox.Text = characterstring[0] + characterstring[1] + characterstring [2] + characterstring [3] + characterstring [4] + characterstring [5] + characterstring [6] + characterstring [7] + characterstring [8] + characterstring [9] + characterstring [10] + characterstring [11] + characterstring [12] + characterstring [13] + characterstring [14] + characterstring [15] + characterstring [16] + characterstring [17] + characterstring [18] + characterstring [19] + characterstring [20];
}