/// <summary> /// Initializes a new instance of the <see cref="KeyEventArgs" /> class. /// </summary> /// <param name="key">The key.</param> /// <param name="scanCode">The platform scan code of the key.</param> /// <param name="state">The state of the key.</param> /// <param name="mods">The modifier keys.</param> public KeyEventArgs(Keys key, int scanCode, InputState state, ModiferKeys mods) { Key = key; ScanCode = scanCode; State = state; Modifiers = mods; }
void KeyCallback(IntPtr window, KeyCode key, int scanCode, InputState state, ModiferKeys mods) { if (this.window == window) { switch (state) { case InputState.Release: OnKeyUp(key); break; case InputState.Repeat: case InputState.Press: OnKeyDown(key); break; } } }
/// <summary> /// Initializes a new instance of the <see cref="MouseButtonEventArgs" /> class. /// </summary> /// <param name="button">The mouse button.</param> /// <param name="state">The state of the <paramref name="button" />.</param> /// <param name="modifiers">The modifier keys.</param> public MouseButtonEventArgs(MouseButton button, InputState state, ModiferKeys modifiers) { Button = button; Action = state; Modifiers = modifiers; }
/// <summary> /// Initializes a new instance of the <see cref="CharEventArgs"/> class. /// </summary> /// <param name="codePoint">A UTF-32 code point.</param> /// <param name="mods">The modifier keys present.</param> public CharEventArgs(uint codePoint, ModiferKeys mods) { CodePoint = codePoint; ModifierKeys = mods; }