166 lines
5.5 KiB
C++
166 lines
5.5 KiB
C++
#include "4J_Input.h"
|
|
#include "INP_Main.h"
|
|
|
|
C_4JInput InputManager;
|
|
|
|
void C_4JInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC)
|
|
{
|
|
InternalInputManager.Initialise(iInputStateC, ucMapC, ucActionC, ucMenuActionC);
|
|
}
|
|
|
|
void C_4JInput::Tick(void)
|
|
{
|
|
InternalInputManager.Tick();
|
|
}
|
|
|
|
void C_4JInput::SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax)
|
|
{
|
|
InternalInputManager.SetDeadzoneAndMovementRange(uiDeadzone, uiMovementRangeMax);
|
|
}
|
|
|
|
void C_4JInput::SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal)
|
|
{
|
|
InternalInputManager.SetGameJoypadMaps(ucMap, ucAction, uiActionVal);
|
|
}
|
|
|
|
unsigned int C_4JInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction)
|
|
{
|
|
return InternalInputManager.GetGameJoypadMaps(ucMap, ucAction);
|
|
}
|
|
|
|
void C_4JInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
|
{
|
|
InternalInputManager.SetJoypadMapVal(iPad, ucMap);
|
|
}
|
|
|
|
unsigned char C_4JInput::GetJoypadMapVal(int iPad)
|
|
{
|
|
return InternalInputManager.GetJoypadMapVal(iPad);
|
|
}
|
|
|
|
void C_4JInput::SetJoypadSensitivity(int iPad, float fSensitivity)
|
|
{
|
|
InternalInputManager.SetJoypadSensitivity(iPad, fSensitivity);
|
|
}
|
|
|
|
unsigned int C_4JInput::GetValue(int iPad, unsigned char ucAction, bool bRepeat)
|
|
{
|
|
return InternalInputManager.GetValue(iPad, ucAction, bRepeat);
|
|
}
|
|
|
|
bool C_4JInput::ButtonPressed(int iPad, unsigned char ucAction)
|
|
{
|
|
return InternalInputManager.ButtonPressed(iPad, ucAction);
|
|
}
|
|
|
|
bool C_4JInput::ButtonReleased(int iPad, unsigned char ucAction)
|
|
{
|
|
return InternalInputManager.ButtonReleased(iPad, ucAction);
|
|
}
|
|
|
|
bool C_4JInput::ButtonDown(int iPad, unsigned char ucAction)
|
|
{
|
|
return InternalInputManager.ButtonDown(iPad, ucAction);
|
|
}
|
|
|
|
void C_4JInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
|
{
|
|
InternalInputManager.SetJoypadStickAxisMap(iPad, uiFrom, uiTo);
|
|
}
|
|
|
|
void C_4JInput::SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
|
{
|
|
InternalInputManager.SetJoypadStickTriggerMap(iPad, uiFrom, uiTo);
|
|
}
|
|
|
|
void C_4JInput::SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs)
|
|
{
|
|
InternalInputManager.SetKeyRepeatRate(fRepeatDelaySecs, fRepeatRateSecs);
|
|
}
|
|
|
|
void C_4JInput::SetDebugSequence(const char *chSequenceA, int (*Func)(LPVOID), LPVOID lpParam)
|
|
{
|
|
InternalInputManager.SetDebugSequence(chSequenceA, Func, lpParam);
|
|
}
|
|
|
|
FLOAT C_4JInput::GetIdleSeconds(int iPad)
|
|
{
|
|
return InternalInputManager.GetIdleSeconds(iPad);
|
|
}
|
|
|
|
bool C_4JInput::IsPadConnected(int iPad)
|
|
{
|
|
return InternalInputManager.IsPadConnected(iPad);
|
|
}
|
|
|
|
float C_4JInput::GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadStick_LX(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
float C_4JInput::GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadStick_LY(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
float C_4JInput::GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadStick_RX(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
float C_4JInput::GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadStick_RY(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
unsigned char C_4JInput::GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadLTrigger(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
unsigned char C_4JInput::GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay)
|
|
{
|
|
return InternalInputManager.GetJoypadRTrigger(iPad, bCheckMenuDisplay);
|
|
}
|
|
|
|
void C_4JInput::SetMenuDisplayed(int iPad, bool bVal)
|
|
{
|
|
InternalInputManager.SetMenuDisplayed(iPad, bVal);
|
|
}
|
|
|
|
C_4JInput::EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR uiTitle, LPCWSTR uiText, DWORD dwPad, WCHAR *pwchResult, UINT uiMaxChars, int(*Func)(LPVOID, const bool), LPVOID lpParam, EKeyboardMode eMode)
|
|
{
|
|
return InternalInputManager.m_Keyboard.RequestKeyboard(uiTitle, uiText, NULL, dwPad, pwchResult, uiMaxChars, Func, lpParam, eMode);
|
|
}
|
|
|
|
C_4JInput::EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR uiTitle, LPCWSTR pwchDefault, LPCWSTR uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiMaxChars, int(*Func)(LPVOID, const bool), LPVOID lpParam, EKeyboardMode eMode)
|
|
{
|
|
return InternalInputManager.m_Keyboard.RequestKeyboard(uiTitle, pwchDefault, uiDesc, dwPad, pwchResult, uiMaxChars, Func, lpParam, eMode);
|
|
}
|
|
|
|
//str1k3r - 3rd RequestKeyboard is for how iggy calls it
|
|
C_4JInput::EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR uiTitle, LPCWSTR uiDesc, DWORD dwPad, UINT uiMaxChars, int(*Func)(LPVOID, const bool), LPVOID lpParam, EKeyboardMode eMode)
|
|
{
|
|
return InternalInputManager.m_Keyboard.RequestKeyboard(uiTitle, NULL, uiDesc, dwPad, NULL, uiMaxChars, Func, lpParam, eMode);
|
|
}
|
|
|
|
C4JStorage::EMessageResult C_4JInput::RequestMessageBox(LPCWSTR uiTitle, LPCWSTR uiText, LPCWSTR *uiButtons, UINT uiButtonCount, DWORD dwPad, int(*Func)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID lpParam, DWORD dwFocusButton)
|
|
{
|
|
return InternalInputManager.m_MessageUI.RequestMessageBox(uiTitle, uiText, uiButtons, uiButtonCount, dwPad, Func, lpParam, dwFocusButton);
|
|
}
|
|
|
|
/*void C_4JInput::GetText(uint16_t *UTF16String)
|
|
{
|
|
InternalInputManager.m_Keyboard.GetText(UTF16String);
|
|
}
|
|
|
|
bool C_4JInput::VerifyStrings(WCHAR **pwStringA, int iStringC, int (*Func)(LPVOID, STRING_VERIFY_RESPONSE *), LPVOID lpParam)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
void C_4JInput::CancelQueuedVerifyStrings(int (*Func)(LPVOID, STRING_VERIFY_RESPONSE *), LPVOID lpParam) {}
|
|
|
|
void C_4JInput::CancelAllVerifyInProgress(void) {}
|
|
|
|
bool C_4JInput::InputDetected(DWORD dwUserIndex,WCHAR *pwchInput) {}*/ |