关于DelphiX与手柄铵钮状态的问题
怎样知道手柄的某个Button按钮的状态呀?
就像TButton对象的KeyDown或KeyUp的事件那样
我下面是这样写的,当手柄Button1一直按着时,这个条件就不停地通过,像连发一样,我不想要,我想单发的,就是按一下后放开就算一次.
if (isUp in DXInput1.States) or (isButton1 in DXInput1.States) then
if vAspect + 1 <= 3 then Inc(vAspect) else vAspect := 0;
.....
我看过DirectInput里的Drun Pad例子,它处理的方法如下
....
for( j = 0; j < dwItems; j++ )
{
// Non-axis data is recieved as "button pressed" or "button
// released". Parse input as such.
BOOL bState = (adod[j].dwData == 0x80 ) ? TRUE : FALSE;
INT index = (INT) adod[j].uAppData;
if( button_states[index] == FALSE && bState )
{
g_lpDrumPad->Play(index, 0, 0);
g_boxColors[index] = 255.0f;
}
button_states[index] = bState;
}
...
DelphiX里有不有像BOOL bState = (adod[j].dwData == 0x80 ) ? TRUE : FALSE;这行的函数啊?