The messages used by mice and joysticks
-
If I put these two functions in a Windows program /*-----*/ void SetTitle(HWND wn,char*S) {SendMessage(wn,WM_SETTEXT,0,(long)S);} /*-----*/ void GetTitle(HWND wn,char*S,long n) {SendMessage(wn,WM_GETTEXT,n,(long)S);} /*-----*/ these functions will set and read the window's title. If I use these to catch the mouse interrupts:- case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_RBUTTONDBLCLK: case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_MBUTTONDBLCLK: case WM_MOUSEMOVE: {int x=short(L&0xffff),y=short(L>>16)&0xffff; char Z[64]; sprintf(Z,"{%d,%d,%2x}",x,y,S); SetTitle(wn,Z); goto DEF;} the window's title will show the current mouse return values. Please, what are the message names used to catch interrupts from a game-type joystick?, if I want to program for a joystick or similar.
-
If I put these two functions in a Windows program /*-----*/ void SetTitle(HWND wn,char*S) {SendMessage(wn,WM_SETTEXT,0,(long)S);} /*-----*/ void GetTitle(HWND wn,char*S,long n) {SendMessage(wn,WM_GETTEXT,n,(long)S);} /*-----*/ these functions will set and read the window's title. If I use these to catch the mouse interrupts:- case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_RBUTTONDBLCLK: case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_MBUTTONDBLCLK: case WM_MOUSEMOVE: {int x=short(L&0xffff),y=short(L>>16)&0xffff; char Z[64]; sprintf(Z,"{%d,%d,%2x}",x,y,S); SetTitle(wn,Z); goto DEF;} the window's title will show the current mouse return values. Please, what are the message names used to catch interrupts from a game-type joystick?, if I want to program for a joystick or similar.