mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[CMD] Enable Ctrl+H (^H) as backspace (#6562)
Ctrl+H should pretend like BackSpace key on Command Prompt. JIRA issue: CORE-5702 - Add Ctrl+H action in ReadCommand function.
This commit is contained in:
parent
c07eb9fb1b
commit
2320c37151
1 changed files with 12 additions and 3 deletions
|
@ -218,8 +218,8 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
|||
curx = orgx;
|
||||
cury = orgy;
|
||||
//bContinue=TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case _T('D'):
|
||||
/* delete current history entry */
|
||||
|
@ -232,8 +232,8 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
|||
ConOutPrintf (_T("%s"), str);
|
||||
GetCursorXY (&curx, &cury);
|
||||
//bContinue=TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#endif /*FEATURE_HISTORY*/
|
||||
|
||||
case _T('M'):
|
||||
|
@ -251,8 +251,16 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
|||
str[charcount] = _T('\0');
|
||||
ConOutChar (_T('\n'));
|
||||
bReturn = TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case _T('H'): /* ^H does the same as VK_BACK */
|
||||
if (dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
|
||||
{
|
||||
bCharInput = FALSE;
|
||||
goto DoBackSpace;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,6 +269,7 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
|||
switch (ir.Event.KeyEvent.wVirtualKeyCode)
|
||||
{
|
||||
case VK_BACK:
|
||||
DoBackSpace:
|
||||
/* <BACKSPACE> - delete character to left of cursor */
|
||||
if (current > 0 && charcount > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue