module AutoClick::InputStructure

Overview

Windows INPUT structure definitions for AutoClick

This module provides Crystal structs that match the Windows INPUT structure used by the SendInput API for mouse and keyboard events.

Extended Modules

Defined in:

auto_click/input_structure.cr

Constant Summary

INPUT_HARDWARE = 2_u32
INPUT_KEYBOARD = 1_u32
INPUT_MOUSE = 0_u32

Input types

KEYEVENTF_EXTENDEDKEY = 1_u32

Keyboard event flags

KEYEVENTF_KEYUP = 2_u32
KEYEVENTF_SCANCODE = 8_u32
KEYEVENTF_UNICODE = 4_u32
MOUSEEVENTF_ABSOLUTE = 32768_u32
MOUSEEVENTF_HWHEEL = 4096_u32
MOUSEEVENTF_LEFTDOWN = 2_u32
MOUSEEVENTF_LEFTUP = 4_u32
MOUSEEVENTF_MIDDLEDOWN = 32_u32
MOUSEEVENTF_MIDDLEUP = 64_u32
MOUSEEVENTF_MOVE = 1_u32

Mouse event flags

MOUSEEVENTF_RIGHTDOWN = 8_u32
MOUSEEVENTF_RIGHTUP = 16_u32
MOUSEEVENTF_WHEEL = 2048_u32
MOUSEEVENTF_XDOWN = 128_u32
MOUSEEVENTF_XUP = 256_u32

Instance Method Summary

Instance Method Detail

def key_down_input(vk : UInt16) : Bytes #

[View source]
def key_up_input(vk : UInt16) : Bytes #

[View source]
def keyboard_input(vk : UInt16, scan : UInt16 = 0_u16, flags : UInt32 = 0_u32, time : UInt32 = 0_u32, extra_info : UInt64 = 0_u64) : Bytes #

Create keyboard input structure

  • vk: Virtual key code
  • scan: Hardware scan code
  • flags: Keyboard event flags
  • time: Timestamp (0 for system time)
  • extra_info: Additional info

[View source]
def left_down_input : Bytes #

[View source]
def left_up_input : Bytes #

[View source]
def middle_down_input : Bytes #

[View source]
def middle_up_input : Bytes #

[View source]
def mouse_input(dx : Int32, dy : Int32, mouse_data : UInt32, dw_flags : UInt32, time : UInt32 = 0_u32, extra_info : UInt64 = 0_u64) : Bytes #

Create mouse input structure

  • dx: X movement or absolute position
  • dy: Y movement or absolute position
  • mouse_data: Additional mouse data (wheel delta, etc.)
  • dw_flags: Mouse event flags
  • time: Timestamp (0 for system time)
  • extra_info: Additional info

[View source]
def right_down_input : Bytes #

[View source]
def right_up_input : Bytes #

[View source]
def send_multiple_inputs(inputs : Array(Bytes)) : UInt32 #

Send multiple input events

  • inputs: Array of input structure bytes

[View source]
def send_single_input(input : Bytes) : UInt32 #

Send a single input event

  • input: Input structure bytes

[View source]
def wheel_input(delta : Int32) : Bytes #

[View source]