Class GlobalKeyboardHookEventArgs
- Namespace
- VisioForge.Core.UI.WinForms.Dialogs
- Assembly
- VisioForge.Core.dll
Provides event data for global keyboard hook events. Contains detailed information about a keyboard event captured by the GlobalKeyboardHook, including the key data, state, and modifier key information.
public class GlobalKeyboardHookEventArgs : HandledEventArgsInheritance
Inherited Members
Remarks
This class extends HandledEventArgs to provide the ability to suppress keyboard events by setting the Handled property to true. When handled, the original keyboard event will not be passed to the target application.
Constructors
GlobalKeyboardHookEventArgs(LowLevelKeyboardInputEvent, KeyboardState)
Initializes a new instance of the VisioForge.Core.UI.WinForms.Dialogs.GlobalKeyboardHookEventArgs class. Creates event arguments for a global keyboard hook event with the specified keyboard data and state.
public GlobalKeyboardHookEventArgs(GlobalKeyboardHook.LowLevelKeyboardInputEvent keyboardData, GlobalKeyboardHook.KeyboardState keyboardState)Parameters
keyboardDataGlobalKeyboardHook.LowLevelKeyboardInputEvent-
The low-level keyboard input event data from the Windows hook system.
keyboardStateGlobalKeyboardHook.KeyboardState-
The state of the keyboard event (key down, key up, system key down, system key up).
Remarks
The Ctrl and Shift properties are not set by this constructor and must be set separately by the calling code based on the current modifier key states.
Properties
Ctrl
Gets or sets a value indicating whether the Control key is currently pressed. This property is determined by checking the asynchronous key state at the time of the event.
public bool Ctrl { get; set; }Property Value
Remarks
This state is captured when the keyboard event occurs and reflects the Control key state at that moment. It's useful for detecting Ctrl+Key combinations.
KeyboardData
Gets the low-level keyboard input event data from the Windows hook system. Contains detailed information about the keyboard event including virtual key code, hardware scan code, flags, timestamp, and additional context information.
public GlobalKeyboardHook.LowLevelKeyboardInputEvent KeyboardData { get; }Property Value
Remarks
This data corresponds to the Windows KBDLLHOOKSTRUCT structure and provides access to all available information about the keyboard event at the system level.
KeyboardState
Gets the state of the keyboard event (key down, key up, system key down, system key up). Indicates whether the event represents a key press, key release, or system key event.
public GlobalKeyboardHook.KeyboardState KeyboardState { get; }Property Value
Remarks
System key events (SysKeyDown, SysKeyUp) typically involve Alt key combinations and are used for system-level keyboard shortcuts.
Shift
Gets or sets a value indicating whether the Shift key is currently pressed. This property is determined by checking the asynchronous key state at the time of the event.
public bool Shift { get; set; }Property Value
Remarks
This state is captured when the keyboard event occurs and reflects the Shift key state at that moment. It's useful for detecting Shift+Key combinations.