// Copyright (C) 2026 SharpEmu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
namespace SharpEmu.HLE.Host;
///
/// Host input devices: gamepad state snapshots, force-feedback/lightbar sinks, and the
/// keyboard-fallback queries. Which physical readers exist (DualSense over raw HID,
/// XInput, evdev, ...) is a backend detail; merge policy between devices and the
/// keyboard lives in the HLE pad exports.
///
public interface IHostInput
{
/// Starts the background device readers once; safe to call repeatedly.
void EnsureStarted();
///
/// Fills with snapshots of currently connected
/// gamepads and returns how many were written (0 when none are connected).
///
int GetGamepadStates(Span destination);
/// Human-readable name of the first connected gamepad, or null.
string? DescribeConnectedGamepad();
/// Sets rumble on all connected gamepads; large = strong/left motor.
void SetRumble(byte largeMotor, byte smallMotor);
///
/// Approximates per-trigger vibration on gamepads without independent trigger
/// actuators; null leaves that trigger's current value unchanged.
///
void SetTriggerRumble(byte? leftTrigger, byte? rightTrigger);
/// Applies native DualSense trigger effects when supported.
void SetAdaptiveTriggerEffect(
HostAdaptiveTriggerEffect? leftTrigger,
HostAdaptiveTriggerEffect? rightTrigger);
void SetLightbar(byte red, byte green, byte blue);
void ResetLightbar();
/// True when a window of this process has keyboard focus.
bool IsHostWindowFocused();
/// Windows virtual-key code semantics; other backends translate.
bool IsKeyDown(int virtualKey);
}