keybd_event in C#

G

Guest

How to use keybd_event api function in c# for combination keys

eg. ctrl+shift +s

I tried like

keybd_event(0x11,0x1D,0,0)
keybd_event(0x10,0xAA,0,0)
keybd_event(0x53,0x1F,0,0)
keybd_event(0x53,0x1F,0x0002,0)
keybd_event(0x10,0xAA,0x0002,0)
keybd_event(0x11,0x1D,0x0002,0)

but it doesn't work

-kannan
 
G

gani

hi,

i'm not familiar with keybd_event. but if you want to
know how to handle ctrl+shift+s in c#, here is a sample
using textbox:

private void textBox1_KeyDown(object
sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.Control && e.Shift &&
e.KeyValue == 83) //83 is 's'
MessageBox.Show
("ctrl+shift+s");
}

HTH

gani
http://thedeveloperscorner.com.ph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top