小编Dud*_*i b的帖子

阅读操纵杆功能

我正试图通过使用winmm.dll库来阅读我的操纵杆功能.我是这样做的......

from ctypes import windll, Structure, c_uint, c_ushort, c_char, c_ulong
WORD = c_ushort
UINT = c_uint
TCHAR = c_char
winmm = windll.LoadLibrary('winmm.dll')
class JOYCAPS(Structure):
   _fields_ = [
    ('wMid', WORD),
    ('wPid', WORD),
    ('szPname', TCHAR * MAXPNAMELEN),  # originally szPname[MAXPNAMELEN]
    ('wXmin', UINT),
    ('wXmax', UINT),
    ('wYmin', UINT),
    ('wYmax', UINT),
    ('wZmin', UINT),
    ('wZmax', UINT),
    ('wNumButtons', UINT),
    ('wPeriodMin', UINT),
    ('wPeriodMax', UINT),
    ('wRmin', UINT),
    ('wRmax', UINT),
    ('wUmin', UINT),
    ('wUmax', UINT),
    ('wVmin', UINT),
    ('wVmax', UINT),
    ('wCaps', UINT),
    ('wMaxAxes', UINT),
    ('wNumAxes', UINT),
    ('wMaxButtons', UINT),
    ('szRegKey', TCHAR …
Run Code Online (Sandbox Code Playgroud)

python msdn ctypes joystick python-3.x

8
推荐指数
1
解决办法
266
查看次数

标签 统计

ctypes ×1

joystick ×1

msdn ×1

python ×1

python-3.x ×1