ZennoLab Assemblies Documentation
KeyboardEvent Enumeration
Example Example 
Specifies the keyboard event.
Syntax
public enum KeyboardEvent : System.Enum 
Members
MemberDescription
DownThe key down event.
PressThe key press event.
UpThe key up event.
Example
The following code example demonstrates uses of the KeyboardEvent enumeration.
// send the key "a"
string result = Emulator.SendKey("Window", 200, 200, System.Windows.Forms.Keys.A, KeyboardEvent.Press);
// check result
if (result == "ok" && !Emulator.ErrorDetected) return "Key was sent";
else return "Fail";
// send the key "a"
$result = Emulator::SendKey("Window", 200, 200, System\Windows\Forms\Keys.A, KeyboardEvent::Press);
// check result
if ($result == "ok" && !Emulator::ErrorDetected) return "Key was sent";
else return "Fail";
// find the html element
HtmlElement he = instance.ActiveTab.FindElementByTag("input:text", 0);
// check the element
if (!he.IsVoid)
{
    // send key
    string result = Emulator.SendKey(instance.ActiveTab.Handle,System.Windows.Forms.Keys.Z, KeyboardEvent.Down); 
    // send result
    if (result == "ok" && !Emulator.ErrorDetected) return "Key was sent";
    return "Fail";
}
return "Element not found";
// find the html element
$he = $instance->ActiveTab->FindElementByTag("input:text", 0);
// check the element
if (!$he->IsVoid)
{
    // send key
    $result = Emulator::SendKey($instance->ActiveTab->Handle, System\Windows\Forms\Keys::Z, KeyboardEvent::Down); 
    // send result
    if ($result == "ok" && !Emulator.ErrorDetected) return "Key was sent";
    return "Fail";
}
return "Element not found";
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         ZennoLab.Emulation.KeyboardEvent

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

Reference

ZennoLab.Emulation Namespace
MouseButton Enumeration
MouseButtonEvent Enumeration
SendKey Method

Send Feedback