1 Star 0 Fork 1

ZxfBugProgrammer/KeyboardSplitterXbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
NativeMethods.cs 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
namespace VirtualXbox
{
using System;
using System.Runtime.InteropServices;
internal static class NativeMethods
{
[DllImport("VirtualXboxNative.dll", EntryPoint = "VBusExists", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool VBusExists();
[DllImport("VirtualXboxNative.dll", EntryPoint = "GetEmptyBusSlotsCount", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GetEmptyBusSlotsCount(out int count);
[DllImport("VirtualXboxNative.dll", EntryPoint = "ControllerExists", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool ControllerExists(uint userIndex);
[DllImport("VirtualXboxNative.dll", EntryPoint = "IsControllerOwned", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool IsControllerOwned(uint userIndex);
[DllImport("VirtualXboxNative.dll", EntryPoint = "PlugIn", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool PlugIn(uint userIndex);
[DllImport("VirtualXboxNative.dll", EntryPoint = "Unplug", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool Unplug(uint userIndex, bool isForced);
[DllImport("VirtualXboxNative.dll", EntryPoint = "GetLedNumber", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GetLedNumber(uint userIndex, out byte ledNumber);
[DllImport("VirtualXboxNative.dll", EntryPoint = "SetButton", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool SetButton(uint userIndex, uint button, bool isPressed);
[DllImport("VirtualXboxNative.dll", EntryPoint = "SetTrigger", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool SetTrigger(uint userIndex, uint button, byte value);
[DllImport("VirtualXboxNative.dll", EntryPoint = "SetDpad", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool SetDpad(uint userIndex, int value);
[DllImport("VirtualXboxNative.dll", EntryPoint = "SetAxis", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool SetAxis(uint userIndex, uint axis, short value);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxfbugprogrammer/KeyboardSplitterXbox.git
git@gitee.com:zxfbugprogrammer/KeyboardSplitterXbox.git
zxfbugprogrammer
KeyboardSplitterXbox
KeyboardSplitterXbox
master

搜索帮助