#ifndef _UMF_JOY_H_ #define _UMF_JOY_H_ #include "types.h" typedef void (*JOY_CallBack_t) (UINT32 KeyCode, UINT32 joypadNum); #define JS_EVENT_BUTTON 0x01 /* button pressed/released */ #define JS_EVENT_AXIS 0x02 /* joystick moved */ #define JS_EVENT_INIT 0x80 /* initial state of device */ #define JS_BTN_PRESSED 1 #define JS_BTN_RELEASED 0 #define MAX_JSNAME_LEN 128 #define MAX_KEY_SIZE 1 #define MAX_EVENT_SIZE 22 #define MAX_JS_NUMBER 2 #define STORE_MAX_JSPAD 5 typedef struct { unsigned int time; /* event timestamp in milliseconds */ short value; /* value */ unsigned char type; /* event type */ unsigned char number; /* axis/button number */ }js_event_t; typedef struct { short value; /* value */ unsigned char type; /* event type */ unsigned char number; /* axis/button number */ }js_key_t; int joystick_init(JOY_CallBack_t pJoy_CallBackFunc); int joystick_add_dev(void); int joystick_remove_dev(void); int joystick_AddEvent_Start(UINT32 event); int joystick_AddEvent_Finish(void); void joystick_SetJSNumber(UINT8 js_number); int joystick_GetDevNumber(void); int joystick_Save(UINT8 js_number); void joystick_Convert_UIEvent_Set(INT32 bConvert); int joystick_Convert_UIEvent_Get(void); #endif