From d47aeda082261e2911df5a6d86848bc3b56993bd Mon Sep 17 00:00:00 2001 From: Reece Date: Thu, 16 Jun 2022 02:29:55 +0100 Subject: [PATCH] [+] EConanonicalInput::eTab [+] if ^::eString, [+] ...isControlSequence, isAltSequence, isShiftSequence [*] Update semaphore from class to struct types [*] GetProfileDomain and frens should check the result string length before returning true --- .../Console/ConsoleStd/ENoncanonicalInput.hpp | 1 + .../Console/ConsoleStd/NoncanonicalInput.hpp | 5 ++++- Include/Aurora/Threading/Primitives/Semaphore.hpp | 3 +-- Source/Console/ConsoleStd/ConsoleStd.cpp | 8 +++++++- Source/IO/FS/Resources.cpp | 14 +++++++------- Source/Threading/Primitives/Semaphore.NT.hpp | 3 +-- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Include/Aurora/Console/ConsoleStd/ENoncanonicalInput.hpp b/Include/Aurora/Console/ConsoleStd/ENoncanonicalInput.hpp index 3a6bf399..300171ba 100644 --- a/Include/Aurora/Console/ConsoleStd/ENoncanonicalInput.hpp +++ b/Include/Aurora/Console/ConsoleStd/ENoncanonicalInput.hpp @@ -21,6 +21,7 @@ namespace Aurora::Console::ConsoleStd ePageUp, ePageDown, eScroll, + eTab, eEnter )); } \ No newline at end of file diff --git a/Include/Aurora/Console/ConsoleStd/NoncanonicalInput.hpp b/Include/Aurora/Console/ConsoleStd/NoncanonicalInput.hpp index 8dc970ca..0cb54a53 100644 --- a/Include/Aurora/Console/ConsoleStd/NoncanonicalInput.hpp +++ b/Include/Aurora/Console/ConsoleStd/NoncanonicalInput.hpp @@ -13,6 +13,9 @@ namespace Aurora::Console::ConsoleStd { ENoncanonicalInput type; AuString string; - int scrollDeltaY; + int scrollDeltaY {}; + bool isControlSequence {}; + bool isAltSequence {}; + bool isShiftSequence {}; }; } \ No newline at end of file diff --git a/Include/Aurora/Threading/Primitives/Semaphore.hpp b/Include/Aurora/Threading/Primitives/Semaphore.hpp index 106d41fa..7ede8ce7 100644 --- a/Include/Aurora/Threading/Primitives/Semaphore.hpp +++ b/Include/Aurora/Threading/Primitives/Semaphore.hpp @@ -9,9 +9,8 @@ namespace Aurora::Threading::Primitives { - class ISemaphore : public IWaitable + struct ISemaphore : IWaitable { - public: virtual void Unlock(long count) = 0; }; diff --git a/Source/Console/ConsoleStd/ConsoleStd.cpp b/Source/Console/ConsoleStd/ConsoleStd.cpp index 9b399746..57db1205 100755 --- a/Source/Console/ConsoleStd/ConsoleStd.cpp +++ b/Source/Console/ConsoleStd/ConsoleStd.cpp @@ -223,10 +223,12 @@ namespace Aurora::Console::ConsoleStd case VK_RETURN: canInput.type = ENoncanonicalInput::eEnter; break; + case VK_TAB: + canInput.type = ENoncanonicalInput::eTab; + break; default: dBreak = true; } - } else { @@ -243,6 +245,10 @@ namespace Aurora::Console::ConsoleStd { canInput.string += key; } + + canInput.isControlSequence = record.Event.KeyEvent.dwControlKeyState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED); + canInput.isAltSequence = record.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED); + canInput.isShiftSequence = record.Event.KeyEvent.dwControlKeyState & (SHIFT_PRESSED); } break; diff --git a/Source/IO/FS/Resources.cpp b/Source/IO/FS/Resources.cpp index 07a17beb..c8c4f659 100644 --- a/Source/IO/FS/Resources.cpp +++ b/Source/IO/FS/Resources.cpp @@ -47,13 +47,13 @@ namespace Aurora::IO::FS AUKN_SYM bool GetSystemDomain(AuString &path) { path = gApplicationData; - return true; + return path.size(); } AUKN_SYM bool GetProfileDomain(AuString &path) { path = gHomeDirectory; - return true; + return path.size(); } AUKN_SYM bool GetSystemResourcePath(const AuString &fileName, AuString &path) @@ -312,7 +312,7 @@ namespace Aurora::IO::FS return false; } path = gUserWritableAppData; - return true; + return path.size(); } AUKN_SYM bool GetUserHome(AuString &path) @@ -323,7 +323,7 @@ namespace Aurora::IO::FS return false; } path = gUserHomeDirectory; - return true; + return path.size(); } AUKN_SYM bool GetPackagePath(AuString &path) @@ -340,7 +340,7 @@ namespace Aurora::IO::FS return false; } path = gGlobalWritableAppDirectory; - return true; + return path.size(); } AUKN_SYM bool GetRootAppdata(AuString &path) @@ -351,7 +351,7 @@ namespace Aurora::IO::FS return false; } path = gAdminWritableAppDirectory; - return true; + return path.size(); } AUKN_SYM bool GetUserProgramsFolder(AuString &path) @@ -362,7 +362,7 @@ namespace Aurora::IO::FS return false; } path = gProgramsFolder; - return true; + return path.size(); } #if defined(AURORA_PLATFORM_WIN32) diff --git a/Source/Threading/Primitives/Semaphore.NT.hpp b/Source/Threading/Primitives/Semaphore.NT.hpp index cf567415..f0c71452 100644 --- a/Source/Threading/Primitives/Semaphore.NT.hpp +++ b/Source/Threading/Primitives/Semaphore.NT.hpp @@ -9,9 +9,8 @@ namespace Aurora::Threading::Primitives { - class Semaphore : public ISemaphore + struct Semaphore : ISemaphore { - public: Semaphore(long intialValue = 0); ~Semaphore();