shithub: puzzles

Download patch

ref: c82820e55b5f1afe487ffd027e54e0d1b6c554ca
parent: a0f376efbd50f16694d4c533d4b2836cfbd48d2c
author: Simon Tatham <anakin@pobox.com>
date: Thu May 26 13:12:04 EDT 2005

Add support for Jacob's new cursor-key modifier flags in the OS X frontend.

[originally from svn r5847]

--- a/osx.m
+++ b/osx.m
@@ -589,21 +589,33 @@
 	 * function key codes.
 	 */
 	if (c >= 0x80) {
+	    int mods = FALSE;
 	    switch (c) {
 	      case NSUpArrowFunctionKey:
 		c = CURSOR_UP;
+		mods = TRUE;
 		break;
 	      case NSDownArrowFunctionKey:
 		c = CURSOR_DOWN;
+		mods = TRUE;
 		break;
 	      case NSLeftArrowFunctionKey:
 		c = CURSOR_LEFT;
+		mods = TRUE;
 		break;
 	      case NSRightArrowFunctionKey:
 		c = CURSOR_RIGHT;
+		mods = TRUE;
 		break;
 	      default:
 		continue;
+	    }
+
+	    if (mods) {
+		if ([ev modifierFlags] & NSShiftKeyMask)
+		    c |= MOD_SHFT;
+		if ([ev modifierFlags] & NSControlKeyMask)
+		    c |= MOD_CTRL;
 	    }
 	}