From af45b9f4614d7018146e68832de3bccb1c73f7e7 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 17 Jan 2013 13:31:30 +0000 Subject: Use SDL 2 instead of SDL 1.2 --- src/client/cl_keys.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/client') diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c index 0fbddd23..191d7fe4 100644 --- a/src/client/cl_keys.c +++ b/src/client/cl_keys.c @@ -438,11 +438,19 @@ void Field_KeyDownEvent( field_t *edit, int key ) { switch ( key ) { case K_DEL: if ( edit->cursor < len ) { - memmove( edit->buffer + edit->cursor, + memmove( edit->buffer + edit->cursor, edit->buffer + edit->cursor + 1, len - edit->cursor ); } break; + case K_BACKSPACE: + if ( edit->cursor > 0 ) { + memmove( edit->buffer + edit->cursor - 1, + edit->buffer + edit->cursor, len + 1 - edit->cursor ); + edit->cursor--; + } + break; + case K_RIGHTARROW: if ( edit->cursor < len ) { edit->cursor++; -- cgit