C# Class MouseKeyboardActivityMonitor.KeyboardState

Contains a snapshor of a keyboard state at certain moment and provides methods of querying waether specific keys are pressed or locked.
This class is basically a managed wrapper of GetKeyboardState API function http://msdn.microsoft.com/en-us/library/ms646299
Afficher le fichier Open project: katopz/oskz-vcsharp

Méthodes publiques

Méthode Description
AreAllDown ( IEnumerable keys ) : bool

Idicates weather every of specified keys were down at the moment when snapshot was created. The method returns flase if even one of them was up.

GetCurrent ( ) : KeyboardState

Makes a snapshot of a keyboard state to the moment of call and returns an instance of KeyboardState class.

IsDown ( Keys key ) : bool

Indicates wether specified key was down at the moment when snapshot was created or not.

IsToggled ( Keys key ) : bool

Indiceate weather specified key was toggled at the moment when snapshot was created or not.

Private Methods

Méthode Description
GetHighBit ( byte value ) : bool
GetKeyState ( Keys key ) : byte
GetLowBit ( byte value ) : bool
GetNativeState ( ) : byte[]
KeyboardState ( byte keyboardStateNative ) : System

Method Details

AreAllDown() public méthode

Idicates weather every of specified keys were down at the moment when snapshot was created. The method returns flase if even one of them was up.
public AreAllDown ( IEnumerable keys ) : bool
keys IEnumerable Keys to verify wether they were down or not.
Résultat bool

GetCurrent() public static méthode

Makes a snapshot of a keyboard state to the moment of call and returns an instance of KeyboardState class.
public static GetCurrent ( ) : KeyboardState
Résultat KeyboardState

IsDown() public méthode

Indicates wether specified key was down at the moment when snapshot was created or not.
public IsDown ( Keys key ) : bool
key Keys Key (corresponds to the virtual code of the key)
Résultat bool

IsToggled() public méthode

Indiceate weather specified key was toggled at the moment when snapshot was created or not.
public IsToggled ( Keys key ) : bool
key Keys Key (corresponds to the virtual code of the key)
Résultat bool