mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 15:41:13 -04:00
[Server] Handle backspace in the server window
This commit is contained in:
parent
4e6bcf02d2
commit
59693abc74
@ -5,10 +5,10 @@ namespace mwmp_input {
|
|||||||
string windowInputBuffer;
|
string windowInputBuffer;
|
||||||
void handler() {
|
void handler() {
|
||||||
char c;
|
char c;
|
||||||
#ifndef WIN32 // on WIndows conio.h getch() and kbhit() are deprecated, use _getch() and _kbhit() instead
|
#ifndef WIN32
|
||||||
while (kbhit()) {
|
while (kbhit()) {
|
||||||
c = getch();
|
c = getch();
|
||||||
#else
|
#else // on Windows conio.h getch() and kbhit() are deprecated, use _getch() and _kbhit() instead
|
||||||
while (_kbhit()) {
|
while (_kbhit()) {
|
||||||
c = _getch();
|
c = _getch();
|
||||||
#endif
|
#endif
|
||||||
@ -18,6 +18,9 @@ namespace mwmp_input {
|
|||||||
Script::Call<Script::CallbackIdentity("OnServerWindowInput")>(windowInputBuffer.c_str());
|
Script::Call<Script::CallbackIdentity("OnServerWindowInput")>(windowInputBuffer.c_str());
|
||||||
windowInputBuffer.assign("");
|
windowInputBuffer.assign("");
|
||||||
}
|
}
|
||||||
|
else if (c == '\b') {
|
||||||
|
windowInputBuffer.erase(windowInputBuffer.size() - 1);
|
||||||
|
}
|
||||||
else windowInputBuffer += c;
|
else windowInputBuffer += c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user