Version: 4.5.0.4
Add terminal emulation to any .NET application or service with VT and Telnet controls.

Windows Forms Key Mapping Code Example

The following example demonstrates mapping a sequence to a pressed key. With a few lines in the VT control's KeyDown event handler, any key can be made to send an alternative sequence.

< Back to all samples for PowerTCP Emulation for .NET

private void vt1_KeyDown(object sender, VtKeyEventArgs e)
{
    //If there is a telnet connection
    if (telnet1.State != Dart.Emulation.ConnectionState.Closed)
    {
        //Send substitute string when Control-H pressed
        if (e.Control && e.KeyCode == Keys.H)
        {
            e.Handled = true//prevent other key events
            telnet1.Write("Hello World!");
        }
    }
}