Hi all,
I am trying to come up with ideas on how I can make configurable controls using SDL for my game...

I want to be able to assign different actions to key events, mouse events, and joystick events (when applicable).

At the moment I have methods in my game class that receives events from the keyboard, mouse, and joysticks (if plugged in) using the SDLinput unit like so:

[pascal]Procedure TGame.OnKeyUp(var Key: TSDLKey; Shift: TSDLMod; unicode : UInt16);
Var
State : TDODBaseState;
Begin
If UpCase(Chr(Key)) = 'S' Then TakeScreenShot('Screenshot.tga');

State := TDODBaseState(FStateMachine.CurrentState);
If Assigned(State) Then
State.OnKeyUp(Key,Shift,unicode)
Else
If Key = SDLK_ESCAPE Then ExitApplication;
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnKeyDown(var Key: TSDLKey; Shift: TSDLMod; unicode : UInt16);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnMouseUp(Button : Integer; Shift: TSDLMod; MousePos : TPoint);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnMouseDown(Button : Integer; Shift: TSDLMod; MousePos : TPoint);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnMouseMove(Shift: TSDLMod; CurrentPos : TPoint; RelativePos : TPoint);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnJoystickUp(Which: UInt8; Button: UInt8; State: SInt16);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnJoystickDown(Which: UInt8; Button: UInt8; State: SInt16);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnAxisMove(Which: UInt8; Axis: UInt8; Value: SInt16);
Begin
If Abs(Value) > 20 Then
Begin
If Axis = 0 Then
Begin
FMoveLeft := Value < 0;
FMoveRight := Value > 0;
End
Else
If Axis = 1 Then
Begin
FMoveUp := Value < 0;
FMoveDown := Value > 0;
End;
End;
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnBallMove(Which: UInt8; Ball: UInt8; RelativePos: TPoint);
Begin
End;
{................................................. .............................}

{................................................. .............................}
Procedure TGame.OnHatMove(Which: UInt8; Hat: UInt8; Value: SInt16);
Begin
End;
[/pascal]

Instead of hard-coding the controls, I want to somehow define actions using user defined keys, buttons, etc.

I THOUGHT there was some post ages ago on this subject, but I can't seem to find one...

cheers,
Paul