mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-31 00:36:42 +00:00
[Server] Handle backspace in the server window
This commit is contained in:
parent
4e6bcf02d2
commit
59693abc74
1 changed files with 5 additions and 2 deletions
|
@ -5,10 +5,10 @@ namespace mwmp_input {
|
|||
string windowInputBuffer;
|
||||
void handler() {
|
||||
char c;
|
||||
#ifndef WIN32 // on WIndows conio.h getch() and kbhit() are deprecated, use _getch() and _kbhit() instead
|
||||
#ifndef WIN32
|
||||
while (kbhit()) {
|
||||
c = getch();
|
||||
#else
|
||||
#else // on Windows conio.h getch() and kbhit() are deprecated, use _getch() and _kbhit() instead
|
||||
while (_kbhit()) {
|
||||
c = _getch();
|
||||
#endif
|
||||
|
@ -18,6 +18,9 @@ namespace mwmp_input {
|
|||
Script::Call<Script::CallbackIdentity("OnServerWindowInput")>(windowInputBuffer.c_str());
|
||||
windowInputBuffer.assign("");
|
||||
}
|
||||
else if (c == '\b') {
|
||||
windowInputBuffer.erase(windowInputBuffer.size() - 1);
|
||||
}
|
||||
else windowInputBuffer += c;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue