mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[MORE] Implement 'Q' key for 'Quit' (#3210)
Implement 'Quit' action for keyboard key 'Q'. CORE-4019
This commit is contained in:
parent
5d5a1a455c
commit
a9f60321f0
1 changed files with 13 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
* PROGRAMMERS: Paolo Pantaleo
|
* PROGRAMMERS: Paolo Pantaleo
|
||||||
* Timothy Schepens
|
* Timothy Schepens
|
||||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||||
|
* Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* MORE.C - external command.
|
* MORE.C - external command.
|
||||||
|
@ -133,6 +134,7 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
|
||||||
*/
|
*/
|
||||||
ConClearLine(Pager->Screen->Stream);
|
ConClearLine(Pager->Screen->Stream);
|
||||||
|
|
||||||
|
/* Ctrl+C or Ctrl+Esc: Control Break */
|
||||||
if ((KeyEvent.wVirtualKeyCode == VK_ESCAPE) ||
|
if ((KeyEvent.wVirtualKeyCode == VK_ESCAPE) ||
|
||||||
((KeyEvent.wVirtualKeyCode == L'C') &&
|
((KeyEvent.wVirtualKeyCode == L'C') &&
|
||||||
(KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))))
|
(KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))))
|
||||||
|
@ -143,6 +145,17 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 'Q': Quit */
|
||||||
|
// FIXME: Available only when command extensions are enabled.
|
||||||
|
if ((KeyEvent.wVirtualKeyCode == L'Q') &&
|
||||||
|
!(KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)))
|
||||||
|
{
|
||||||
|
/* We break, output a newline */
|
||||||
|
WCHAR ch = L'\n';
|
||||||
|
ConStreamWrite(Pager->Screen->Stream, &ch, 1);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue