From 262c59442e409b147f1dc83add633ae96c7785e0 Mon Sep 17 00:00:00 2001 From: nigel <> Date: Mon, 18 Mar 2002 11:00:27 +0000 Subject: [PATCH] Extra code to map cursor keys --- BasiliskII/src/MacOSX/EmulatorView.mm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/MacOSX/EmulatorView.mm b/BasiliskII/src/MacOSX/EmulatorView.mm index ab0e2fc7..ea3d5eb4 100644 --- a/BasiliskII/src/MacOSX/EmulatorView.mm +++ b/BasiliskII/src/MacOSX/EmulatorView.mm @@ -261,13 +261,31 @@ static int prevFlags; - (void) keyDown: (NSEvent *) event { if ( [self processKeyEvent: event] ) - ADBKeyDown([event keyCode]); + { + int code = [event keyCode]; + + if ( code == 126 ) code = 0x3e; // CURS_UP + if ( code == 125 ) code = 0x3d; // CURS_DOWN + if ( code == 124 ) code = 0x3c; // CURS_RIGHT + if ( code == 123 ) code = 0x3b; // CURS_LEFT + + ADBKeyDown(code); + } } - (void) keyUp: (NSEvent *) event { if ( [self processKeyEvent: event] ) - ADBKeyUp([event keyCode]); + { + int code = [event keyCode]; + + if ( code == 126 ) code = 0x3e; // CURS_UP + if ( code == 125 ) code = 0x3d; // CURS_DOWN + if ( code == 124 ) code = 0x3c; // CURS_RIGHT + if ( code == 123 ) code = 0x3b; // CURS_LEFT + + ADBKeyUp(code); + } } static NSPoint mouse; // Previous/current mouse location