• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

using keybd_event() function in C$#

How to use the function    keybd_event(); in C#  which fiels need to be included;  please provide a
short example, I am getting syntax errors,  

0
amielDorel
Asked:
amielDorel
1 Solution
 
vilimedCommented:
Your best bet would be to use the SendKeys class to send keyboard
strokes to your application.
0
 
johnaryanCommented:
Here's one I use for KeyUp

/// <summary>
            /// Raises the KeyUp event
            /// </summary>
            /// <param name="e">A KeyEventArgs that contains the event data</param>
            protected override void OnKeyUp(KeyEventArgs e)
            {
                  base.OnKeyUp(e);

                  if (e.KeyCode == Keys.Space || e.KeyCode == Keys.Enter)
                  {
                        this.Collapsed = !this.Collapsed;
                  }
            }

John
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now