diff options
Diffstat (limited to 'src/game/client/lineinput.cpp')
| -rw-r--r-- | src/game/client/lineinput.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/client/lineinput.cpp b/src/game/client/lineinput.cpp index b5d35ef8..29b891c2 100644 --- a/src/game/client/lineinput.cpp +++ b/src/game/client/lineinput.cpp @@ -27,19 +27,19 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p int CursorPos = *pCursorPosPtr; int Len = *pStrLenPtr; bool Changes = false; - + if(CursorPos > Len) CursorPos = Len; - + int Code = e.m_Unicode; int k = e.m_Key; - + // 127 is produced on Mac OS X and corresponds to the delete key if (!(Code >= 0 && Code < 32) && Code != 127) { char Tmp[8]; int CharSize = str_utf8_encode(Tmp, Code); - + if (Len < StrMaxSize - CharSize && CursorPos < StrMaxSize - CharSize) { mem_move(pStr + CursorPos + CharSize, pStr + CursorPos, Len - CursorPos + CharSize); @@ -50,7 +50,7 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p Changes = true; } } - + if(e.m_Flags&IInput::FLAG_PRESS) { if (k == KEY_BACKSPACE && CursorPos > 0) @@ -79,7 +79,7 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p else if (k == KEY_END) CursorPos = Len; } - + *pCursorPosPtr = CursorPos; *pStrLenPtr = Len; |