Home > Software engineering >  How handle the message interception access
How handle the message interception access

Time:11-07

Global hooks, keyboard or news for this I know, if the handle is available to you, belong to what kind of message, thank you

CodePudding user response:

JoyStick


SDL - mirror/SDL
Tasssadar/libenjoy

Directlnput or XInput technology

API
//read the handle information
UINT joyNums;
JoyNums=joyGetNumDevs ();
//printf (" the number of the current handle: % d \ n ", joyNums);
If (joyNums>
=1){
MMRESULT joyreturn=joyGetPosEx (JOYSTICKID1, & amp; Joyinfoex);
If (joyreturn==JOYERR_NOERROR)
{
Printf (" 09 0 x % d ", joyinfoex dwXpos);
Printf (" 09 0 x % d ", joyinfoex dwYpos);
//printf (" 0 x % 9 x ", joyinfoex dwZpos);
//printf (" 0 x % 9 x ", joyinfoex dwPOV);
//printf (" 0 x % 9 x ", joyinfoex dwButtons);
printf("\n");
} the else
{
The switch (joyreturn)
{
Case JOYERR_PARMS:
Printf (" bad parameters \ n ");
break;
Case JOYERR_NOCANDO:
Printf (" request not completed \ n ");
break;
Case JOYERR_UNPLUGGED:
Printf (" joystick is unplugged \ n ");
break;
Default:
An unknown error printf (" \ n ");
break;
}
}
}
  • Related