https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a9f60321f088ebd2b02a3…
commit a9f60321f088ebd2b02a334cd7241c9e1df21475
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Sep 20 07:16:21 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 20 07:16:21 2020 +0900
[MORE] Implement 'Q' key for 'Quit' (#3210)
Implement 'Quit' action for keyboard key 'Q'. CORE-4019
---
base/applications/cmdutils/more/more.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/base/applications/cmdutils/more/more.c
b/base/applications/cmdutils/more/more.c
index 161818a5e6b..14dd0d54c32 100644
--- a/base/applications/cmdutils/more/more.c
+++ b/base/applications/cmdutils/more/more.c
@@ -8,6 +8,7 @@
* PROGRAMMERS: Paolo Pantaleo
* Timothy Schepens
* Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ * Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
*/
/*
* MORE.C - external command.
@@ -133,6 +134,7 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
*/
ConClearLine(Pager->Screen->Stream);
+ /* Ctrl+C or Ctrl+Esc: Control Break */
if ((KeyEvent.wVirtualKeyCode == VK_ESCAPE) ||
((KeyEvent.wVirtualKeyCode == L'C') &&
(KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))))
@@ -143,6 +145,17 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
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;
}