mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
Implemented history on windows
This commit is contained in:
parent
d226b36f44
commit
5fc6c3ddd7
@ -131,7 +131,11 @@ static std::string CompositeInput;
|
|||||||
static bool CompositeInputExpected { false };
|
static bool CompositeInputExpected { false };
|
||||||
|
|
||||||
static void ProcessCompositeInput() {
|
static void ProcessCompositeInput() {
|
||||||
|
#ifdef WIN32
|
||||||
|
if (CompositeInput == "H") {
|
||||||
|
#else // unix
|
||||||
if (CompositeInput.size() == 2 && memcmp(CompositeInput.data(), std::array<char, 2> { 91, 65 }.data(), 2) == 0) {
|
if (CompositeInput.size() == 2 && memcmp(CompositeInput.data(), std::array<char, 2> { 91, 65 }.data(), 2) == 0) {
|
||||||
|
#endif // WIN32
|
||||||
// UP ARROW
|
// UP ARROW
|
||||||
info(std::to_string(ConsoleHistoryReadIndex));
|
info(std::to_string(ConsoleHistoryReadIndex));
|
||||||
if (!ConsoleHistory.empty()) {
|
if (!ConsoleHistory.empty()) {
|
||||||
@ -140,7 +144,11 @@ static void ProcessCompositeInput() {
|
|||||||
}
|
}
|
||||||
CInputBuff = ConsoleHistory.at(ConsoleHistoryReadIndex);
|
CInputBuff = ConsoleHistory.at(ConsoleHistoryReadIndex);
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
} else if (CompositeInput == "P") {
|
||||||
|
#else // unix
|
||||||
} else if (CompositeInput.size() == 2 && memcmp(CompositeInput.data(), std::array<char, 2> { 91, 66 }.data(), 2) == 0) {
|
} else if (CompositeInput.size() == 2 && memcmp(CompositeInput.data(), std::array<char, 2> { 91, 66 }.data(), 2) == 0) {
|
||||||
|
#endif // WIN32
|
||||||
// DOWN ARROW
|
// DOWN ARROW
|
||||||
info(std::to_string(ConsoleHistoryReadIndex));
|
info(std::to_string(ConsoleHistoryReadIndex));
|
||||||
if (!ConsoleHistory.empty()) {
|
if (!ConsoleHistory.empty()) {
|
||||||
@ -171,7 +179,11 @@ static void ProcessCompositeInput() {
|
|||||||
//info(std::to_string(In));
|
//info(std::to_string(In));
|
||||||
if (CompositeInputExpected) {
|
if (CompositeInputExpected) {
|
||||||
CompositeInput += In;
|
CompositeInput += In;
|
||||||
|
#ifdef WIN32
|
||||||
|
if (CompositeInput.size() == 1) {
|
||||||
|
#else // unix
|
||||||
if (CompositeInput.size() == 2) {
|
if (CompositeInput.size() == 2) {
|
||||||
|
#endif // WIN32
|
||||||
CompositeInputExpected = false;
|
CompositeInputExpected = false;
|
||||||
ProcessCompositeInput();
|
ProcessCompositeInput();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user