Computer.Keyboard Property

Definition

Gets an object that provides properties for accessing the current state of the keyboard, such as what keys are currently pressed, and provides a method to send keystrokes to the active window.

public:
 property Microsoft::VisualBasic::Devices::Keyboard ^ Keyboard { Microsoft::VisualBasic::Devices::Keyboard ^ get(); };
public Microsoft.VisualBasic.Devices.Keyboard Keyboard { get; }
member this.Keyboard : Microsoft.VisualBasic.Devices.Keyboard
Public ReadOnly Property Keyboard As Keyboard

Property Value

The My.Computer.Keyboard object for the computer.

Examples

This example uses the My.Computer.Keyboard.CtrlKeyDown property to determine if the computer's CTRL key is currently pressed.

If My.Computer.Keyboard.CtrlKeyDown Then
    MsgBox("CTRL key down")
Else
    MsgBox("CTRL key up")
End If

Remarks

This property provides easy access to the My.Computer.Keyboard object. For more information, see Keyboard object.

Availability by Project Type

Project type Available
Windows Forms Application Yes
Class Library Yes
Console Application Yes
Windows Forms Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No

Applies to

See also