mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-30 14:39:42 +08:00
2b6bd5a532
* [audio] added sdl audio backend and in-tree atrac9 decoder * [input] replaced per-platform pad readers with sdl gamepad input * [video] added sdl window and host display plumbing * [gui] added host display options and per-game render settings * [bink] synced host movie playback to the guest audio clock * [cpu] hooked windows write faults into guest image tracking * [perf] added guest and render profiling, reserved host cpu lanes * [kernel] fixed stale pthread mutex handle alias * [host] wired the sdl session, save-data paths and project references * [audio] hoisted ajm trace stackalloc out of its loop * [video] Add guest image sync setting * [build] Strip native symbols * reuse
50 lines
1.9 KiB
C#
50 lines
1.9 KiB
C#
// Copyright (C) 2026 SharpEmu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
namespace SharpEmu.HLE.Host;
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public interface IHostInput
|
|
{
|
|
/// <summary>Starts the background device readers once; safe to call repeatedly.</summary>
|
|
void EnsureStarted();
|
|
|
|
/// <summary>
|
|
/// Fills <paramref name="destination"/> with snapshots of currently connected
|
|
/// gamepads and returns how many were written (0 when none are connected).
|
|
/// </summary>
|
|
int GetGamepadStates(Span<HostGamepadState> destination);
|
|
|
|
/// <summary>Human-readable name of the first connected gamepad, or null.</summary>
|
|
string? DescribeConnectedGamepad();
|
|
|
|
/// <summary>Sets rumble on all connected gamepads; large = strong/left motor.</summary>
|
|
void SetRumble(byte largeMotor, byte smallMotor);
|
|
|
|
/// <summary>
|
|
/// Approximates per-trigger vibration on gamepads without independent trigger
|
|
/// actuators; null leaves that trigger's current value unchanged.
|
|
/// </summary>
|
|
void SetTriggerRumble(byte? leftTrigger, byte? rightTrigger);
|
|
|
|
/// <summary>Applies native DualSense trigger effects when supported.</summary>
|
|
void SetAdaptiveTriggerEffect(
|
|
HostAdaptiveTriggerEffect? leftTrigger,
|
|
HostAdaptiveTriggerEffect? rightTrigger);
|
|
|
|
void SetLightbar(byte red, byte green, byte blue);
|
|
|
|
void ResetLightbar();
|
|
|
|
/// <summary>True when a window of this process has keyboard focus.</summary>
|
|
bool IsHostWindowFocused();
|
|
|
|
/// <summary>Windows virtual-key code semantics; other backends translate.</summary>
|
|
bool IsKeyDown(int virtualKey);
|
|
}
|