summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2014-09-13 22:00:10 +0000
committermichi_cc <michi_cc@openttd.org>2014-09-13 22:00:10 +0000
commit5a2fd3630b4c942da25bbb0e5d5f4aee850fb2b3 (patch)
treefe31aaf37d537ff2b16c33494eeaffc6bb01e68a /src/video
parentc2c0585b8f9345323ef847462fbcd7cf046362e8 (diff)
downloadopenttd-5a2fd3630b4c942da25bbb0e5d5f4aee850fb2b3.tar.xz
(svn r26818) -Fix [FS#AndyShouldHaveFoundFlySprayByNow] (r26758): [OSX] Line history and scrolling in the console window went on a walk.
Diffstat (limited to 'src/video')
-rw-r--r--src/video/cocoa/cocoa_v.mm48
1 files changed, 48 insertions, 0 deletions
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
{