From 5a2fd3630b4c942da25bbb0e5d5f4aee850fb2b3 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sat, 13 Sep 2014 22:00:10 +0000 Subject: (svn r26818) -Fix [FS#AndyShouldHaveFoundFlySprayByNow] (r26758): [OSX] Line history and scrolling in the console window went on a walk. --- src/video/cocoa/cocoa_v.mm | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index e9b4b5b8f..4df7cb003 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -1136,6 +1136,30 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count) if (EditBoxInGlobalFocus()) HandleKeypress(WKC_RIGHT | WKC_CTRL, 0); } +/** Move cursor one line up. */ +- (void)moveUp:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_UP, 0); +} + +/** Move cursor one line down. */ +- (void)moveDown:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_DOWN, 0); +} + +/** MScroll one line up. */ +- (void)moveUpAndModifySelection:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_UP | WKC_SHIFT, 0); +} + +/** Scroll one line down. */ +- (void)moveDownAndModifySelection:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_DOWN | WKC_SHIFT, 0); +} + /** Move cursor to the start of the line. */ - (void)moveToBeginningOfLine:(id)sender { @@ -1148,6 +1172,30 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count) if (EditBoxInGlobalFocus()) HandleKeypress(WKC_END, 0); } +/** Scroll one page up. */ +- (void)scrollPageUp:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_PAGEUP, 0); +} + +/** Scroll one page down. */ +- (void)scrollPageDown:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_PAGEDOWN, 0); +} + +/** Move cursor (and selection) one page up. */ +- (void)pageUpAndModifySelection:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_PAGEUP | WKC_SHIFT, 0); +} + +/** Move cursor (and selection) one page down. */ +- (void)pageDownAndModifySelection:(id)sender +{ + if (EditBoxInGlobalFocus()) HandleKeypress(WKC_PAGEDOWN | WKC_SHIFT, 0); +} + /** Scroll to the beginning of the document. */ - (void)scrollToBeginningOfDocument:(id)sender { -- cgit v1.2.3-54-g00ecf