#ifndef __CONTROLS
#define __CONTROLS

#include "config.h"
#include "vectors.h"

enum{
	kInputGasButton,
	kInputBrakeButton,
	kInputSteerLeftButton,
	kInputSteerRightButton,
	kInputHandbrakeButton,
	kInputKickdownButton,
	kInputGearUp,
	kInputGearDown,
	kInputLightButton,
	kInputHorn,
	kInputChat,
	kInputCamera,
	kInputPause,
	kInputEscape,
	kInputCameraReverse,
	kInputTaunt1,
	kInputTaunt2,
	kInuptTaunt3,
	kInputTaunt4,
	kInputTaunt5,	
	kInputCameraChangeCar,
	kInputITunesNext,
	kInputITunesPrev,
	kInputITunesPlay,
	kInputLeftIndicator,
	kInputRightIndicator,
	kInputNumControls
};

enum{
	kInterfaceKeyNone,
	kInterfaceKeyUp,
	kInterfaceKeyDown,
	kInterfaceKeyLeft,
	kInterfaceKeyRight,
	kInterfaceKeySpace,
	kInterfaceKeyReturn,
	kInterfaceKeyEnter,
	kInterfaceKeyEsc,
	kInterfaceKeyEasterEgg,
	kInterfaceKeyDelete,
	kInterfaceKeyCmd,
	kInterfaceKeyOpt,
	kInterfaceKeyS,
	kInterfaceKeyR,
	kInterfaceKeyQ,
	kInterfaceMouseDown,
	kInterfaceNumKeys
};

enum{
	kInputSteerAxis,
	kInputThrottleBrakeAxis,
	kInputThrottleAxis,
	kInputBrakeAxis,
	kInputNumAxis
};

enum{
	kInputEscModeNone,
	kInputEscModeNormal,
	kInputEscModeQuit
};

extern int gFFB;
extern int gInputHID;
extern int gInputChatMode;
extern int gInputEscMode;
extern int gInputEscSelection;
extern float gStartPauseTime;
extern char gGameChatMessage[];
extern int gGameChatMessageSize;

void ControlFrame();
void ControlInit();
void ControlExit();
int GetButtonInput(int id);
int GetInterfaceKey(int id);
char GetKeyInput(int *key);
char PeekKeyInput(int *key);
float GetAxisInput(int id);
void GetInput(tKeyConfig *keyConfig);
void GetAxis(tAxisConfig *axis,bool allowVendor);
void FlushKeys();
void FFBJolt(float lMag,float rMag,float duration);
void FFBiShockDirect(float lMag,float rMag);
void FFBSetSteerResistance(float res,float alignment);
void FFBSetGoundRumble(float velo, float rumble);
void FFBStop();
void CalibrateAxis(int id);
tVector2 GetMousePos();

#endif