教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 学前教育 >

C - 手柄模拟鼠标控制(2)

来源:网络收集 时间:2026-08-24
导读: /// [DllImport(\ public static extern int joyGetPosEx(int uJoyID, ref JOYINFOEX pji); 上面的两个API函数,我们可以从中任选一个,但joyGetPos函数只能取得1,2,3,4号四个按钮的状态。所以建议不用,下面只重讲

/// [DllImport(\ public static extern int joyGetPosEx(int uJoyID, ref JOYINFOEX pji); 上面的两个API函数,我们可以从中任选一个,但joyGetPos函数只能取得1,2,3,4号四个按钮的状态。所以建议不用,下面只重讲解joyGetPosEx函数! JOYINFO 与 JOYINFOEX 是属于结构体,它们的定义如下:

#region 游戏手柄的位置与按钮状态 ///

/// 游戏手柄的位置与按钮状态 /// [StructLayout(LayoutKind.Sequential)] public struct JOYINFO { public int wXpos; public int wYpos; public int wZpos; public int wButtons; } /// /// 游戏手柄的位置与按钮状态 /// [StructLayout(LayoutKind.Sequential)] public struct JOYINFOEX { /// /// Size, in bytes, of this structure. /// public int dwSize; /// /// Flags indicating the valid information returned in this structure. Members that do not contain valid information are set to zero. /// public int dwFlags; /// /// Current X-coordinate. /// public int dwXpos; /// /// Current Y-coordinate. /// public int dwYpos; /// /// Current Z-coordinate. /// public int dwZpos; /// /// Current position of the rudder or fourth joystick axis. /// public int dwRpos; /// /// Current fifth axis position. /// public int dwUpos; /// /// Current sixth axis position. /// public int dwVpos; /// /// Current state of the 32 joystick buttons. The value of this member can be set to any combination of JOY_BUTTONn flags, where n is a value in the range of 1 through 32 corresponding to the button that is pressed. /// public int dwButtons; /// /// Current button number that is pressed. /// public int dwButtonNumber; /// /// Current position of the point-of-view control. Values for this member are in the range 0 through 35,900. These values represent the angle, in degrees, of each view multiplied by 100. /// public int dwPOV; /// /// Reserved; do not use. ///
C - 手柄模拟鼠标控制(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/595701.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)