WORD wLastKey = 0;
TCHAR ch;
BOOL bContinue=FALSE;/*is TRUE the second case will not be executed*/
+ BOOL bReturn = FALSE;
+ TCHAR szPath[MAX_PATH];
/* get screen size */
GetScreenSize (&maxx, &maxy);
do
{
+
+ bReturn = FALSE;
+
ConInKey (&ir);
if (ir.Event.KeyEvent.dwControlKeyState &
}
else
{
-#ifdef __REACTOS__
- Beep (440, 50);
-#else
MessageBeep (-1);
-#endif
}
#endif
#ifdef FEATURE_4NT_FILENAME_COMPLETION
/* used to later see if we went down to the next line */
tempscreen = charcount;
- TCHAR szPath[MAX_PATH];
- szPath[0]=_T('\0');
+ szPath[0]=_T('\0');
/* str is the whole things that is on the current line
that is and and out. arg 2 is weather it goes back
if(((charcount + orgx) / maxx) + orgy > maxy - 1)
orgy += maxy - ((charcount + orgx) / maxx + orgy + 1);
}
- SetCursorXY((orgx + current) % maxx, orgy + (orgx + current) / maxx);
+ SetCursorXY((short)(((int)orgx + current) % maxx), (short)((int)orgy + ((int)orgx + current) / maxx));
GetCursorXY(&curx, &cury);
#endif
break;
-
+
+ case _T('M'):
+ case _T('C'):
+ /* ^M does the same as return */
+ if(!(ir.Event.KeyEvent.dwControlKeyState &
+ (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
+ {
+ break;
+ }
+
case VK_RETURN:
/* end input, return to main */
#ifdef FEATURE_HISTORY
#endif
ConInDummy ();
ConOutChar (_T('\n'));
+ bReturn = TRUE;
break;
case VK_ESCAPE:
}
else
{
-#ifdef __REACTOS__
- Beep (440, 50);
-#else
MessageBeep (-1);
-#endif
}
break;
}
break;
- default:
+ }
#ifdef _UNICODE
- ch = ir.Event.KeyEvent.uChar.UnicodeChar;
- if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
+ ch = ir.Event.KeyEvent.uChar.UnicodeChar;
+ if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)) &&
+ !(ir.Event.KeyEvent.dwControlKeyState & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
#else
- ch = ir.Event.KeyEvent.uChar.AsciiChar;
- if ((UCHAR)ch >= 32 && (charcount != (maxlen - 2)))
+ ch = ir.Event.KeyEvent.uChar.AsciiChar;
+ if ((UCHAR)ch >= 32 && (charcount != (maxlen - 2)) &&
+ !(ir.Event.KeyEvent.dwControlKeyState & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
#endif /* _UNICODE */
- {
- /* insert character into string... */
- if (bInsert && current != charcount)
- {
- /* If this character insertion will cause screen scrolling,
- * adjust the saved origin of the command prompt. */
- tempscreen = _tcslen(str + current) + curx;
- if ((tempscreen % maxx) == (maxx - 1) &&
- (tempscreen / maxx) + cury == (maxy - 1))
- {
- orgy--;
- cury--;
- }
-
- for (count = charcount; count > current; count--)
- str[count] = str[count - 1];
- str[current++] = ch;
- if (curx == maxx - 1)
- curx = 0, cury++;
- else
- curx++;
- ConOutPrintf (_T("%s"), &str[current - 1]);
- SetCursorXY (curx, cury);
- charcount++;
- }
- else
- {
- if (current == charcount)
- charcount++;
- str[current++] = ch;
- if (GetCursorX () == maxx - 1 && GetCursorY () == maxy - 1)
- orgy--, cury--;
- if (GetCursorX () == maxx - 1)
- curx = 0, cury++;
- else
- curx++;
- ConOutChar (ch);
- }
- }
-#if 0
- else
- {
-#ifdef __REACTOS__
- Beep (440, 100);
-#else
- MessageBeep (-1);
-#endif
- }
-#endif
- break;
-
- }
+ {
+ /* insert character into string... */
+ if (bInsert && current != charcount)
+ {
+ /* If this character insertion will cause screen scrolling,
+ * adjust the saved origin of the command prompt. */
+ tempscreen = _tcslen(str + current) + curx;
+ if ((tempscreen % maxx) == (maxx - 1) &&
+ (tempscreen / maxx) + cury == (maxy - 1))
+ {
+ orgy--;
+ cury--;
+ }
+
+ for (count = charcount; count > current; count--)
+ str[count] = str[count - 1];
+ str[current++] = ch;
+ if (curx == maxx - 1)
+ curx = 0, cury++;
+ else
+ curx++;
+ ConOutPrintf (_T("%s"), &str[current - 1]);
+ SetCursorXY (curx, cury);
+ charcount++;
+ }
+ else
+ {
+ if (current == charcount)
+ charcount++;
+ str[current++] = ch;
+ if (GetCursorX () == maxx - 1 && GetCursorY () == maxy - 1)
+ orgy--, cury--;
+ if (GetCursorX () == maxx - 1)
+ curx = 0, cury++;
+ else
+ curx++;
+ ConOutChar (ch);
+ }
+ }
+
wLastKey = ir.Event.KeyEvent.wVirtualKeyCode;
}
- while (ir.Event.KeyEvent.wVirtualKeyCode != VK_RETURN);
+ while (!bReturn);
SetCursorType (bInsert, TRUE);
}