I m making a keylogger application. so want to capture capture all keystrokes
like
my code like this
case Keys.A: TextBox1.text=TextBox1.text+"A";
break;
but i want that when user press
Shift+2, Shift+A than it print @ and A respectively.
how can i determine that shift key is pressed or not?
Loading

Jaish MathewsRank #225 · 11K reputationPosted Jun 7, 2010, 8:34 PM EDT
I am normally using Key_Down event like below to catch Shift key
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.A) && e.Shift)
{
MessageBox.Show("Shift + A");
}
else if (e.KeyCode.Equals(Keys.A))
{
MessageBox.Show("A");
}
}
CrishRank #1,486 · 1.1K reputationPosted Jun 5, 2010, 9:36 PM EDT
try below code
private void MyProg_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar.ToString()) { case "0": kryBtn0_Click(sender, e); e.Handled = true; break; case "1": kryBtn1_Click(sender, e); e.Handled = true; break; case "2": kryBtn2_Click(sender, e); e.Handled = true; break; default: e.Handled = true; break; } }Amit Kumar14 reputationPosted Jun 5, 2010, 11:20 PM EDT
my main problem is to how to determine that Shift key pressed or not?
Amit Kumar14 reputationPosted Jun 7, 2010, 2:13 PM EDT