diff --git a/4JLibs.sln b/4JLibs.sln index 00176a3..d791413 100644 --- a/4JLibs.sln +++ b/4JLibs.sln @@ -83,20 +83,18 @@ Global Release|Xbox 360 = Release|Xbox 360 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.ActiveCfg = Debug|Durango - {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.Build.0 = Debug|Durango - {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.Deploy.0 = Debug|Durango + {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.ActiveCfg = Release|Durango + {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Durango.Build.0 = Release|Durango {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|ORBIS.ActiveCfg = Debug|ORBIS {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|ORBIS.Build.0 = Debug|ORBIS - {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PS3.ActiveCfg = Debug|PS3 - {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PS3.Build.0 = Debug|PS3 + {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PS3.ActiveCfg = Release|PS3 + {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|PS3.Build.0 = Release|PS3 {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Windows64.ActiveCfg = Debug|x64 {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Windows64.Build.0 = Debug|x64 {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 {A9125E77-A460-46FB-8EF3-2166F8657226}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.ActiveCfg = Release|Durango {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.Build.0 = Release|Durango - {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Durango.Deploy.0 = Release|Durango {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|ORBIS.ActiveCfg = Release|ORBIS {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|ORBIS.Build.0 = Release|ORBIS {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|PS3.ActiveCfg = Release|PS3 @@ -105,29 +103,27 @@ Global {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Windows64.Build.0 = Release|x64 {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 {A9125E77-A460-46FB-8EF3-2166F8657226}.Release|Xbox 360.Build.0 = Release|Xbox 360 - {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.ActiveCfg = Debug|Durango - {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.Build.0 = Debug|Durango - {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.Deploy.0 = Debug|Durango + {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.ActiveCfg = Release|Durango + {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Durango.Deploy.0 = Release|Durango {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|ORBIS.ActiveCfg = Debug|ORBIS {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|ORBIS.Build.0 = Debug|ORBIS - {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|PS3.ActiveCfg = Debug|PS3 + {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|PS3.ActiveCfg = Release|PS3 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Windows64.ActiveCfg = Debug|x64 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Windows64.Build.0 = Debug|x64 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Debug|Xbox 360.ActiveCfg = Debug|x64 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.ActiveCfg = Release|Durango - {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.Build.0 = Release|Durango {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Durango.Deploy.0 = Release|Durango {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|ORBIS.ActiveCfg = Release|ORBIS {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|PS3.ActiveCfg = Release|PS3 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Windows64.ActiveCfg = Release|x64 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Windows64.Build.0 = Release|x64 {C3833C67-05E4-4D6C-8707-22F95B6939E4}.Release|Xbox 360.ActiveCfg = Release|x64 - {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.ActiveCfg = Debug|Durango - {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Build.0 = Debug|Durango - {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Deploy.0 = Debug|Durango + {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.ActiveCfg = Release|Durango + {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Build.0 = Release|Durango + {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Durango.Deploy.0 = Release|Durango {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|ORBIS.ActiveCfg = Debug|ORBIS {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|ORBIS.Build.0 = Debug|ORBIS - {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|PS3.ActiveCfg = Debug|PS3 + {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|PS3.ActiveCfg = Release|PS3 {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Windows64.ActiveCfg = Debug|x64 {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Windows64.Build.0 = Debug|x64 {22938163-5DDB-4D04-883B-07212EB99FAE}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 @@ -139,29 +135,26 @@ Global {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Windows64.ActiveCfg = Release|x64 {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Windows64.Build.0 = Release|x64 {22938163-5DDB-4D04-883B-07212EB99FAE}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.ActiveCfg = Debug|Durango - {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.Build.0 = Debug|Durango - {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.Deploy.0 = Debug|Durango + {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.ActiveCfg = Release|Durango + {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Durango.Deploy.0 = Release|Durango {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|ORBIS.ActiveCfg = Debug|ORBIS {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|ORBIS.Build.0 = Debug|ORBIS - {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|PS3.ActiveCfg = Debug|PS3 + {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|PS3.ActiveCfg = Release|PS3 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Windows64.ActiveCfg = Debug|x64 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Windows64.Build.0 = Debug|x64 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.ActiveCfg = Release|Durango - {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.Build.0 = Release|Durango {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Durango.Deploy.0 = Release|Durango {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|ORBIS.ActiveCfg = Release|ORBIS {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|PS3.ActiveCfg = Release|PS3 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Windows64.ActiveCfg = Release|x64 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Windows64.Build.0 = Release|x64 {2E28BC2E-BF30-4C83-A4D8-C967DD409D70}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.ActiveCfg = Debug|Durango - {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.Build.0 = Debug|Durango + {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.ActiveCfg = Release|Durango {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Durango.Deploy.0 = Debug|Durango {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|ORBIS.ActiveCfg = Debug|ORBIS {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|ORBIS.Build.0 = Debug|ORBIS - {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|PS3.ActiveCfg = Debug|PS3 + {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|PS3.ActiveCfg = Release|PS3 {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Windows64.ActiveCfg = Debug|x64 {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 {D0FDED0B-7704-4376-82DC-FF4377A7CD53}.Release|Durango.ActiveCfg = Release|Durango diff --git a/4J_Input/4J_Input.vcxproj b/4J_Input/4J_Input.vcxproj index 328826c..d23330a 100644 --- a/4J_Input/4J_Input.vcxproj +++ b/4J_Input/4J_Input.vcxproj @@ -43,16 +43,6 @@ - - true - true - true - true - true - true - true - true - true true @@ -73,16 +63,6 @@ true true - - true - true - true - true - true - true - true - true - true true @@ -1106,16 +1086,6 @@ true true - - true - true - true - true - true - true - true - true - true true @@ -1136,16 +1106,6 @@ true true - - true - true - true - true - true - true - true - true - true true @@ -1505,6 +1465,7 @@ ../Headers/PS3;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories) GenerateWarnings + $(ProjectDir)/stdafx.h; @@ -1515,6 +1476,7 @@ ../Headers/PS3;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories) + $(ProjectDir)/stdafx.h; diff --git a/4J_Input/4J_Input.vcxproj.filters b/4J_Input/4J_Input.vcxproj.filters index 70b3be4..03bc20d 100644 --- a/4J_Input/4J_Input.vcxproj.filters +++ b/4J_Input/4J_Input.vcxproj.filters @@ -291,18 +291,12 @@ Header Files - - Header Files - Header Files Header Files - - Header Files - Header Files @@ -356,18 +350,12 @@ Source Files - - Source Files - Source Files Source Files - - Source Files - Source Files diff --git a/4J_Input/Orbis/4J_Input.cpp b/4J_Input/Orbis/4J_Input.cpp index b7cda3a..820f8e2 100644 --- a/4J_Input/Orbis/4J_Input.cpp +++ b/4J_Input/Orbis/4J_Input.cpp @@ -1,14 +1,181 @@ -#include "INP_OnScreenKeyboard.h" -#include "4J_Input.h" #include "INP_Main.h" -//str1k3r - to be renamed SelectBackSwapped +#include "4J_Input.h" +#include "INP_OnScreenKeyboard.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 uiDeadzoneDigital, unsigned int uiMovementRangeMax ) +{ + InternalInputManager.SetDeadzoneAndMovementRange(uiDeadzone, uiDeadzoneDigital, 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); +} + void C_4JInput::SetCircleCrossSwapped(bool swapped) { - InternalInputManager.m_iSelectBackSwapped = swapped; + InternalInputManager.m_bSwappedEnter = swapped; } bool C_4JInput::IsCircleCrossSwapped() { - return InternalInputManager.m_iSelectBackSwapped; + return InternalInputManager.m_bSwappedEnter; +} + +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); +} + +ScePadTouchData* C_4JInput::GetTouchPadData(int iPad, bool bCheckMenuDisplay) +{ + return InternalInputManager.GetTouchPadData(iPad, bCheckMenuDisplay); +} + +void C_4JInput::SetMenuDisplayed(int iPad, bool bVal) +{ + InternalInputManager.SetMenuDisplayed(iPad, bVal); +} + +C_4JInput::EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int(*Func)(LPVOID, const bool), LPVOID lpParam, EKeyboardMode eMode) +{ + return InternalInputManager.m_Keyboard.RequestKeyboard(Title, Text, dwPad, uiMaxChars, Func, lpParam, eMode); +} + +void C_4JInput::DestroyKeyboard() +{ + InternalInputManager.m_Keyboard.DestroyKeyboard(); +} + +void C_4JInput::GetText(uint16_t *UTF16String) +{ + InternalInputManager.m_Keyboard.GetText(UTF16String); +} + +void C_4JInput::SetLocalMultiplayer(bool inProgress) +{ + ; +} + +bool C_4JInput::IsLocalMultiplayerAvailable() +{ + ; +} + +bool C_4JInput::UsingRemoteVita() +{ + ; +} + +bool C_4JInput::VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam) +{ + return false; } \ No newline at end of file diff --git a/4J_Input/Orbis/INP_ForceFeedback.cpp b/4J_Input/Orbis/INP_ForceFeedback.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/4J_Input/Orbis/INP_ForceFeedback.h b/4J_Input/Orbis/INP_ForceFeedback.h deleted file mode 100644 index 737ae6f..0000000 --- a/4J_Input/Orbis/INP_ForceFeedback.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -class CForceFeedback -{ -}; \ No newline at end of file diff --git a/4J_Input/Orbis/INP_Main.cpp b/4J_Input/Orbis/INP_Main.cpp index e69de29..b30b6e7 100644 --- a/4J_Input/Orbis/INP_Main.cpp +++ b/4J_Input/Orbis/INP_Main.cpp @@ -0,0 +1,577 @@ +#include "INP_Main.h" + +CInput InternalInputManager; + +CInput::CInput() +{ + m_Keyboard = CKeyboard(); + + m_uiSigninJoypadMask = 0; + for (int i = 0; i < 4; ++i) + m_bIsMenuDisplayed[i] = 0; + + InitTime(); + + m_fRepeatDelaySecs = 0.5f; + m_fRepeatRateSecs = 0.8f; + m_sDebugSequenceName = 0; + m_uiDebugSequenceIndex = 0; + m_pDebugSequenceFn = 0; +#if TO_BE_IMPLEMENTED + *((_BYTE *)&loc_650 + this + 1) = 0; +#endif +} + +CInput::~CInput() +{ + //~CKeyboard +} + +void CInput::DebugPrintf(const char *szFormat, ...) +{ + va_list ap; + va_start(ap, szFormat); + char buf[1024]; + vsnprintf(buf, sizeof(buf), szFormat, ap); + va_end(ap); + printf(buf); +} + +void CInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC) +{ + assert(iInputStateC > 0); + assert(ucMapC > 0); + assert(ucActionC > 0); + + sceUserServiceInitialize(NULL); + scePadInit(); + + memset(m_Joypads, 0, sizeof(m_Joypads)); + + m_ucInputStateC = iInputStateC; + + m_iDeadzone = 0x2; + m_iMovementRangeMax = 0x7F; + + m_iEffectiveRange = m_iMovementRangeMax - m_iDeadzone; + m_fEffectiveRange = (float)m_iEffectiveRange; + m_iHalfRange = static_cast(m_iEffectiveRange * 0.75); + + for (int i = 0; i < MAX_JOYPADS; i++) + { + m_Joypads[i].m_pInputStates = new ScePadData[m_ucInputStateC]; + m_Joypads[i].m_ucInputStateIndex = -1; + m_Joypads[i].m_pfLeftThumbXAxisMap = &m_Joypads[i].m_fNormalizedLeftThumbX; + m_Joypads[i].m_pfLeftThumbYAxisMap = &m_Joypads[i].m_fNormalizedLeftThumbY; + m_Joypads[i].m_pfRightThumbXAxisMap = &m_Joypads[i].m_fNormalizedRightThumbX; + m_Joypads[i].m_pfRightThumbYAxisMap = &m_Joypads[i].m_fNormalizedRightThumbY; + m_Joypads[i].m_pucLeftTriggerAxisMap = &m_Joypads[i].m_ucLeftTriggerState; + m_Joypads[i].m_pucRightTriggerAxisMap = &m_Joypads[i].m_ucRightTriggerState; + m_Joypads[i].m_fSensitivity = 1.0f; + } + + m_JoypadMap = (unsigned int **)operator new[](ucMapC * sizeof(int *)); + for (int i = 0; i < ucMapC; i++) + { + m_JoypadMap[i] = (unsigned int *)operator new[](ucActionC * sizeof(int)); + } + + m_ucJoypadMapC = ucMapC; + m_ucJoypadMapActionC = ucActionC; + m_ucMenuActionC = ucMenuActionC; + m_bJoypadMapArrayIsSetup = false; +} + +void CInput::Tick() +{ + UpdateJoypads(); + m_Keyboard.Tick(); +} + +void CInput::SetJoypadValues(JOYPAD *pThisPad) +{ + ScePadData *pGamePad = &pThisPad->m_pInputStates[pThisPad->m_ucInputStateIndex]; + + pThisPad->m_uiButtons = pThisPad->m_uiOldButtons; + + //str1k3r - decomp uses pThisPad->m_uiButtons not pGamePad->buttons + if (pGamePad->buttons == SCE_PAD_BUTTON_CROSS) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_X; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_CIRCLE) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_O; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_SQUARE) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_SQUARE; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_TRIANGLE) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_TRIANGLE; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_R2) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_R2; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_L2) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_L2; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_R1) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_R1; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_L1) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_L1; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_OPTIONS) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_OPTIONS; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_TOUCH_PAD) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_TOUCHPAD; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_R3) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_R3; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_L3) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_L3; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_UP) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_DPAD_UP; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_DOWN) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_DPAD_DOWN; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_LEFT) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_DPAD_LEFT; + } + + if (pGamePad->buttons == SCE_PAD_BUTTON_RIGHT) + { + pThisPad->m_uiButtons |= _PS4_JOY_BUTTON_DPAD_RIGHT; + } + + pThisPad->m_iNormalizedLeftThumbX = pThisPad->m_iLeftThumbX / m_iEffectiveRange; + pThisPad->m_iNormalizedLeftThumbY = pThisPad->m_iLeftThumbY / m_iEffectiveRange; + pThisPad->m_iNormalizedRightThumbX = pThisPad->m_iRightThumbX / m_iEffectiveRange; + pThisPad->m_iNormalizedRightThumbY = pThisPad->m_iRightThumbY / m_iEffectiveRange; + + pThisPad->m_fNormalizedLeftThumbX = pThisPad->m_iLeftThumbX / m_fEffectiveRange; + pThisPad->m_fNormalizedLeftThumbY = pThisPad->m_iLeftThumbY / m_fEffectiveRange; + pThisPad->m_fNormalizedRightThumbX = pThisPad->m_iRightThumbX / m_fEffectiveRange; + pThisPad->m_fNormalizedRightThumbY = pThisPad->m_iRightThumbY / m_fEffectiveRange; +} + +void CInput::SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiDeadzoneDigital, unsigned int uiMovementRangeMax) +{ + m_iDeadzone = uiDeadzone; + m_iDeadzoneDigital = uiDeadzoneDigital; + m_iMovementRangeMax = uiMovementRangeMax; + m_iEffectiveRange = uiMovementRangeMax - uiDeadzone; +} + +void CInput::SetJoypadSensitivity(int iPad, float fSensitivity) +{ + m_Joypads[iPad].m_fSensitivity = fSensitivity; +} + +void CInput::SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal) +{ + assert(ucMap < m_ucJoypadMapC); + assert(ucAction < m_ucJoypadMapActionC); + + m_JoypadMap[ucMap][ucAction] = uiActionVal; +} + +unsigned int CInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction) +{ + assert(ucMap < m_ucJoypadMapC); + assert(ucAction < m_ucJoypadMapActionC); + + return m_JoypadMap[ucMap][ucAction]; +} + +void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap) +{ + m_bJoypadMapArrayIsSetup = true; + m_Joypads[iPad].m_ucMappingValue = ucMap; +} + +unsigned char CInput::GetJoypadMapVal(int iPad) +{ + return m_Joypads[iPad].m_ucMappingValue; +} + +void CInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo) +{ + float *pfTo = NULL; + + switch (uiTo) + { + case AXIS_MAP_LX: + pfTo = &m_Joypads[iPad].m_fNormalizedLeftThumbX; + break; + case AXIS_MAP_LY: + pfTo = &m_Joypads[iPad].m_fNormalizedLeftThumbY; + break; + case AXIS_MAP_RX: + pfTo = &m_Joypads[iPad].m_fNormalizedRightThumbX; + break; + case AXIS_MAP_RY: + pfTo = &m_Joypads[iPad].m_fNormalizedRightThumbY; + break; + } + + switch (uiFrom) + { + case AXIS_MAP_LX: + m_Joypads[iPad].m_pfLeftThumbXAxisMap = pfTo; + break; + case AXIS_MAP_LY: + m_Joypads[iPad].m_pfLeftThumbYAxisMap = pfTo; + break; + case AXIS_MAP_RX: + m_Joypads[iPad].m_pfRightThumbXAxisMap = pfTo; + break; + case AXIS_MAP_RY: + m_Joypads[iPad].m_pfRightThumbYAxisMap = pfTo; + break; + } +} + +void CInput::SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo) +{ + unsigned char *pucTo = NULL; + + switch (uiTo) + { + case TRIGGER_MAP_0: + pucTo = &m_Joypads[iPad].m_ucRightTriggerState; + break; + case TRIGGER_MAP_1: + pucTo = &m_Joypads[iPad].m_ucLeftTriggerState; + break; + } + + switch (uiFrom) + { + case TRIGGER_MAP_0: + m_Joypads[iPad].m_pucRightTriggerAxisMap = pucTo; + break; + case TRIGGER_MAP_1: + m_Joypads[iPad].m_pucLeftTriggerAxisMap = pucTo; + break; + } +} + +bool CInput::IsPadConnected(int iPad) +{ + return m_Joypads[iPad].m_bIsConnected; +} + +void CInput::SetSigninJoypadMask(unsigned int mask) +{ + m_uiSigninJoypadMask = mask; +} + +unsigned int CInput::GetValue(int iPad, unsigned char ucAction, bool bRepeat) +{ + if (m_bIsMenuDisplayed[iPad] && ucAction > this->m_ucMenuActionC) + { + return 0; + } + + unsigned char ucMap = this->m_Joypads[iPad].m_ucMappingValue; + unsigned int uiVal = this->m_JoypadMap[ucMap][ucAction] & this->m_Joypads[iPad].m_uiButtons; + if (!uiVal || !bRepeat) + { + return uiVal; + } + + int iKeyVal = 0; + for (int iKey = this->m_JoypadMap[ucMap][ucAction]; (iKey & 1) == 0; iKey >>= 1) + { + iKeyVal++; + } + + if (m_fRepeatDelaySecs <= m_Timers[iPad][iKeyVal].m_fTotalHoldTime || m_Timers[iPad][iKeyVal].m_bInitialPressHandled) + { + if (m_Timers[iPad][iKeyVal].m_fTotalHoldTime < m_fRepeatDelaySecs) + { + return 0; + } + else if (m_Timers[iPad][iKeyVal].m_fLastRepeatTime == 0.0f) + { + m_Timers[iPad][iKeyVal].m_fLastRepeatTime = m_fRepeatDelaySecs; + return uiVal; + } + else if ((m_Timers[iPad][iKeyVal].m_fTotalHoldTime - m_Timers[iPad][iKeyVal].m_fLastRepeatTime) <= m_fRepeatRateSecs) + { + return 0; + } + else + { + m_Timers[iPad][iKeyVal].m_fLastRepeatTime = m_Timers[iPad][iKeyVal].m_fLastRepeatTime + m_fRepeatRateSecs; + return uiVal; + } + } + else + { + m_Timers[iPad][iKeyVal].m_bInitialPressHandled = true; + return uiVal; + } +} + +bool CInput::IsSet(int iPad, unsigned char ucAction) +{ + return (!m_bIsMenuDisplayed[iPad] || ucAction <= m_ucMenuActionC) && + (m_JoypadMap[m_Joypads[iPad].m_ucMappingValue][ucAction] & m_Joypads[iPad].m_uiButtons) != 0; +} + +bool CInput::ButtonPressed(int iPad, unsigned char ucAction) +{ + if (ucAction == 255) + { + return m_Joypads[iPad].m_uiButtonsPressed != 0; + } + + if (m_bIsMenuDisplayed[iPad] && ucAction > m_ucMenuActionC) + { + return 0; + } + + return (m_JoypadMap[m_Joypads[iPad].m_ucMappingValue][ucAction] & m_Joypads[iPad].m_uiButtonsPressed) != 0; +} + +bool CInput::ButtonReleased(int iPad, unsigned char ucAction) +{ + return (!m_bIsMenuDisplayed[iPad] || ucAction <= m_ucMenuActionC) && + (m_JoypadMap[m_Joypads[iPad].m_ucMappingValue][ucAction] & m_Joypads[iPad].m_uiButtonsReleased) != 0; +} + +bool CInput::ButtonDown(int iPad, unsigned char ucAction) +{ + if (ucAction == 255) + { + return m_Joypads[iPad].m_uiButtons != 0; + } + + if (m_bIsMenuDisplayed[iPad] && ucAction > m_ucMenuActionC) + { + return 0; + } + + return (m_JoypadMap[m_Joypads[iPad].m_ucMappingValue][ucAction] & m_Joypads[iPad].m_uiButtons) != 0; +} + +float CInput::GetJoypadStick_Menu_LX(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_iNormalizedLeftThumbX; +} + +float CInput::GetJoypadStick_Menu_LY(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_iNormalizedLeftThumbY; +} + +float CInput::GetJoypadStick_Menu_RX(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_iNormalizedRightThumbX; +} + +float CInput::GetJoypadStick_Menu_RY(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_iNormalizedRightThumbY; +} + +unsigned char CInput::GetJoypadLTrigger_Menu(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_ucLeftTriggerState; +} + +unsigned char CInput::GetJoypadRTrigger_Menu(unsigned char ucPad) +{ + return m_Joypads[ucPad].m_ucRightTriggerState; +} + +float CInput::GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0.0f; + } + + return *m_Joypads[iPad].m_pfLeftThumbXAxisMap * m_Joypads[iPad].m_fSensitivity; +} + +float CInput::GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0.0f; + } + + return *m_Joypads[iPad].m_pfLeftThumbYAxisMap * m_Joypads[iPad].m_fSensitivity; +} + +float CInput::GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0.0f; + } + + return *m_Joypads[iPad].m_pfRightThumbXAxisMap * m_Joypads[iPad].m_fSensitivity; +} + +float CInput::GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0.0f; + } + + return *m_Joypads[iPad].m_pfRightThumbYAxisMap * m_Joypads[iPad].m_fSensitivity; +} + +unsigned char CInput::GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0; + } + + return *m_Joypads[iPad].m_pucLeftTriggerAxisMap; +} + +unsigned char CInput::GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0; + } + + return *m_Joypads[iPad].m_pucRightTriggerAxisMap; +} + +ScePadTouchData* CInput::GetTouchPadData(int iPad, bool bCheckMenuDisplay) +{ + if (bCheckMenuDisplay && m_bIsMenuDisplayed[iPad]) + { + return 0; + } + + return &m_Joypads[iPad].m_pInputStates->touchData; +} + +void CInput::SetMenuDisplayed(int iPad, bool bVal) +{ + m_bIsMenuDisplayed[iPad] = bVal; +} + +void CInput::SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs) +{ + m_fRepeatDelaySecs = fRepeatDelaySecs; + m_fRepeatRateSecs = fRepeatRateSecs; +} + +void CInput::SetDebugSequence(const char *chSequenceA, int (*Func)(LPVOID), LPVOID lpParam) +{ + int iLen = strlen(chSequenceA); + + m_sDebugSequenceName = (char *)operator new[](iLen); + strcpy(m_sDebugSequenceName, chSequenceA); + + m_pDebugSequenceFn = Func; + m_pDebugSequenceParam = lpParam; +} + +FLOAT CInput::GetIdleSeconds(int iPad) +{ + ; +} + +bool CInput::UpdateJoypads() +{ + assert(m_bJoypadMapArrayIsSetup); + + for (int i = 0; i < MAX_JOYPADS; i++) + { + JOYPAD *pThisPad = &m_Joypads[i]; + + pThisPad->m_uiOldButtons = pThisPad->m_uiButtons; + pThisPad->m_uiButtons = 0; + pThisPad->m_ucLeftTriggerState = 0; + pThisPad->m_ucRightTriggerState = 0; + } + + for (int i = 0; i < MAX_JOYPADS; i++) + { + if (ProfileManager.IsSignedIn(i)) + { + SceUserServiceUserId UserID = ProfileManager.getUserID(i); + } + } + + return true; +} + +void CInput::ClearJoypadValues(JOYPAD *pThisPad) +{ + pThisPad->m_uiButtonsPressed = 0; + pThisPad->m_uiButtonsReleased = 0; + pThisPad->m_uiButtons = 0; + pThisPad->m_ucLeftTriggerState = 0; + pThisPad->m_ucRightTriggerState = 0; + pThisPad->m_iRightThumbX = 0; + pThisPad->m_iRightThumbY = 0; + pThisPad->m_iLeftThumbX = 0; + pThisPad->m_iLeftThumbY = 0; + pThisPad->m_iNormalizedLeftThumbX = 0; + pThisPad->m_iNormalizedLeftThumbY = 0; + pThisPad->m_iNormalizedRightThumbX = 0; + pThisPad->m_iNormalizedRightThumbY = 0; + pThisPad->m_fNormalizedLeftThumbX = 0.0f; + pThisPad->m_fNormalizedLeftThumbY = 0.0f; + pThisPad->m_fNormalizedRightThumbX = 0.0f; + pThisPad->m_fNormalizedRightThumbY = 0.0f; +} + +void CInput::InitTime(void) +{ + ; +} + +void CInput::GetStartTime(int iPad, int iKey) +{ + ; +} + +void CInput::UpdateTime(int iPad, int iKey) +{ + ; +} \ No newline at end of file diff --git a/4J_Input/Orbis/INP_Main.h b/4J_Input/Orbis/INP_Main.h index 3064a26..4bdbf28 100644 --- a/4J_Input/Orbis/INP_Main.h +++ b/4J_Input/Orbis/INP_Main.h @@ -1,10 +1,165 @@ -#pragma once +#include "stdafx.h" + +#include "4J_Input.h" +#include "INP_OnScreenKeyboard.h" + +#define MAX_JOYPADS 4 class CInput { public: - bool m_iSelectBackSwapped; + struct XINPUT_STATE {}; + + struct JOYPAD + { + bool m_bIsConnected; + bool m_bWasConnected; + bool m_bHasConnected; + + unsigned int m_uiButtons; + unsigned int m_uiOldButtons; + int m_uiButtonsPressed; + int m_uiButtonsReleased; + + int m_iRightThumbX; + int m_iRightThumbY; + int m_iLeftThumbX; + int m_iLeftThumbY; + + DWORD m_iNormalizedRightThumbX; + DWORD m_iNormalizedRightThumbY; + DWORD m_iNormalizedLeftThumbX; + DWORD m_iNormalizedLeftThumbY; + + float m_fNormalizedRightThumbX; + float m_fNormalizedRightThumbY; + float m_fNormalizedLeftThumbX; + float m_fNormalizedLeftThumbY; + + unsigned char m_ucLeftTriggerState; + unsigned char m_ucRightTriggerState; + + float *m_pfLeftThumbXAxisMap; + float *m_pfLeftThumbYAxisMap; + float *m_pfRightThumbXAxisMap; + float *m_pfRightThumbYAxisMap; + + float m_fSensitivity; + + BYTE *m_pucLeftTriggerAxisMap; + BYTE *m_pucRightTriggerAxisMap; + + unsigned char m_ucMappingValue; + int m_ucInputStateIndex; + ScePadData *m_pInputStates; + }; + + struct TimeInfo + { + LARGE_INTEGER m_qwStartTime; + LARGE_INTEGER m_qwTotalHoldTicks; + float m_fTotalHoldTime; + float m_fLastRepeatTime; + bool m_bInitialPressHandled; + }; + + CInput(); + ~CInput(); + + void DebugPrintf(const char *szFormat, ...); + + void Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC); + void Tick(); + + void SetJoypadValues(JOYPAD *); + void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiDeadzoneDigital, unsigned int uiMovementRangeMax); + void SetJoypadSensitivity(int iPad, float fSensitivity); + + void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal); + unsigned int GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction); + + void SetJoypadMapVal(int iPad, unsigned char ucMap); + unsigned char GetJoypadMapVal(int iPad); + + void SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo); + void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo); + + bool IsPadConnected(int iPad); + void SetSigninJoypadMask(unsigned int mask); + unsigned int GetValue(int iPad, unsigned char ucAction, bool bRepeat); + bool IsSet(int iPad, unsigned char ucAction); + + bool ButtonPressed(int iPad, unsigned char ucAction); + bool ButtonReleased(int iPad, unsigned char ucAction); + bool ButtonDown(int iPad, unsigned char ucAction); + + float GetJoypadStick_Menu_LX(unsigned char ucPad); + float GetJoypadStick_Menu_LY(unsigned char ucPad); + float GetJoypadStick_Menu_RX(unsigned char ucPad); + float GetJoypadStick_Menu_RY(unsigned char ucPad); + unsigned char GetJoypadLTrigger_Menu(unsigned char ucPad); + unsigned char GetJoypadRTrigger_Menu(unsigned char ucPad); + + float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay = true); + float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay = true); + float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay = true); + float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay = true); + unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay = true); + unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay = true); + ScePadTouchData* GetTouchPadData(int iPad, bool bCheckMenuDisplay); + + void SetMenuDisplayed(int iPad, bool bVal); + + void SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs); + void SetDebugSequence(const char *chSequenceA, int (*Func)(LPVOID), LPVOID lpParam); + FLOAT GetIdleSeconds(int iPad); + + bool UpdateJoypads(); + void ClearJoypadValues(JOYPAD *pThisPad); + void InitTime(void); + void GetStartTime(int iPad, int iKey); + void UpdateTime(int, int); +private: + JOYPAD m_Joypads[MAX_JOYPADS]; + + int m_iDeadzone; + int m_iDeadzoneDigital; + int m_iMovementRangeMax; + int m_iEffectiveRange; + int m_iHalfRange; + float m_fEffectiveRange; + + unsigned char m_ucInputStateC; + unsigned char m_ucJoypadMapC; + unsigned char m_ucJoypadMapActionC; + unsigned char m_ucMenuActionC; + + unsigned int **m_JoypadMap; + + bool m_bSelectBackSwapped; + bool m_bLostInput; + + bool m_bJoypadMapArrayIsSetup; + unsigned int m_uiSigninJoypadMask; + bool m_bIsMenuDisplayed[MAX_JOYPADS]; + +public: + CKeyboard m_Keyboard; + + bool m_bSwappedEnter; +private: + + float m_fTickToSeconds; + float m_fRepeatDelaySecs; + float m_fRepeatRateSecs; + + TimeInfo m_Timers[MAX_JOYPADS][24]; + LARGE_INTEGER m_LastActivityTime[MAX_JOYPADS]; + + char *m_sDebugSequenceName; + unsigned int m_uiDebugSequenceIndex; + int (*m_pDebugSequenceFn)(void *); + LPVOID m_pDebugSequenceParam; }; -// Singleton extern CInput InternalInputManager; \ No newline at end of file diff --git a/4J_Input/Orbis/INP_OnScreenKeyboard.cpp b/4J_Input/Orbis/INP_OnScreenKeyboard.cpp index e69de29..85d5cc4 100644 --- a/4J_Input/Orbis/INP_OnScreenKeyboard.cpp +++ b/4J_Input/Orbis/INP_OnScreenKeyboard.cpp @@ -0,0 +1,39 @@ +#include "INP_Main.h" +#include "INP_OnScreenKeyboard.h" + +CKeyboard::CKeyboard() +{ +} + +void CKeyboard::Tick() +{ +} + +void CKeyboard::GetText(uint16_t *UTF16String) +{ +} + +C_4JInput::EKeyboardResult CKeyboard::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode) +{ +} + +void CKeyboard::DestroyKeyboard() +{ + if (m_iMode == 4) + m_pFunc = NULL; +} + +void CKeyboard::SetMode(int mode) +{ + m_iMode = mode; +} + +CKeyboard *CKeyboard::GetInstance() +{ + return m_pInstance; +} + +int CKeyboard::GetMode() +{ + return m_iMode; +} \ No newline at end of file diff --git a/4J_Input/Orbis/INP_OnScreenKeyboard.h b/4J_Input/Orbis/INP_OnScreenKeyboard.h index d719bf0..28a3e72 100644 --- a/4J_Input/Orbis/INP_OnScreenKeyboard.h +++ b/4J_Input/Orbis/INP_OnScreenKeyboard.h @@ -1,5 +1,46 @@ #pragma once +#include "4J_Input.h" + class CKeyboard { +public: + // PIEBOT: m_iMode is supposed to be using eKeyboardProcessState + // I'll leave that work to someone else. + enum eKeyboardProcessState + { + }; + + CKeyboard(); + + void Tick(); + void GetText(uint16_t *UTF16String); + C_4JInput::EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode); + void DestroyKeyboard(); + + void register_osk_callback(); + //static bool OSK_KeyhookCallback(CellOskDialogKeyMessage *keyMessage, unsigned int *action, void *pActionInfo); + static void KeyboardEventsCallback(uint64_t status, uint64_t param, CKeyboard* userdata); + void SetKeyboardLanguage(); + + void SetMode(int mode); + CKeyboard *GetInstance(); + int GetMode(); +private: + int m_iMode; + + int (*m_pFunc)(LPVOID, const bool); + LPVOID m_lpParam; + //CellOskDialogParam m_pDialogParam; + float m_fX; + float m_fY; + //CellOskDialogInputFieldInfo inputFieldInfo; + + //CellOskDialogCallbackReturnParam m_pDialogReturn; + uint16_t *m_pText[513]; + + int m_iLanguage; + + CKeyboard *m_pInstance; + int m_pTickCountdown; }; \ No newline at end of file diff --git a/4J_Input/Orbis/LinkedList.cpp b/4J_Input/Orbis/LinkedList.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/4J_Input/Orbis/LinkedList.h b/4J_Input/Orbis/LinkedList.h deleted file mode 100644 index 3a5d9d7..0000000 --- a/4J_Input/Orbis/LinkedList.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -class LinkedList -{ -}; \ No newline at end of file diff --git a/4J_Profile/4J_Profile.vcxproj b/4J_Profile/4J_Profile.vcxproj index 3d94775..b378e6a 100644 --- a/4J_Profile/4J_Profile.vcxproj +++ b/4J_Profile/4J_Profile.vcxproj @@ -219,14 +219,6 @@ true Unicode - - v140 - StaticLibrary - - - v140 - StaticLibrary - Clang StaticLibrary @@ -243,6 +235,14 @@ SNC StaticLibrary + + v110 + StaticLibrary + + + v110 + StaticLibrary + @@ -252,6 +252,12 @@ + + + + + + $(ProjectName)_d diff --git a/4J_Render/4J_Render.vcxproj b/4J_Render/4J_Render.vcxproj index ebb032a..6be6b5f 100644 --- a/4J_Render/4J_Render.vcxproj +++ b/4J_Render/4J_Render.vcxproj @@ -316,10 +316,12 @@ Unicode - v140 + v110 + StaticLibrary - v140 + v110 + StaticLibrary Clang @@ -344,16 +346,16 @@ - - - - + - + + + +