shithub: puzzles

Download patch

ref: cd6d48a15938374d6ed4685139568f3b856b40df
parent: ef8ff388d6a9aa710f00d50742707aff6d5910b3
author: sirjofri <sirjofri@sirjofri.de>
date: Fri May 24 08:32:59 EDT 2024

adds (un|re)do, solve, proper mouse input processing

--- a/plan9.c
+++ b/plan9.c
@@ -689,6 +689,15 @@
 	case 'n':
 		midend_process_key(fe->me, 0, 0, UI_NEWGAME);
 		break;
+	case 'u':
+		midend_process_key(fe->me, 0, 0, UI_UNDO);
+		break;
+	case 'r':
+		midend_process_key(fe->me, 0, 0, UI_REDO);
+		break;
+	case 's':
+		midend_process_key(fe->me, 0, 0, UI_SOLVE);
+		break;
 	default:
 		if (midend_process_key(fe->me, 0, 0, k) == PKR_QUIT)
 			return 1;
@@ -756,15 +765,21 @@
 	
 	if ( ((*lm)&1) && !(m->buttons&1))
 		r = midend_process_key(fe->me, x, y, LEFT_RELEASE);
+	if ( ((*lm)&1) &&  (m->buttons&1))
+		r = midend_process_key(fe->me, x, y, LEFT_DRAG);
 	if (!((*lm)&1) &&  (m->buttons&1))
 		r = midend_process_key(fe->me, x, y, LEFT_BUTTON);
 	if ( ((*lm)&2) && !(m->buttons&2))
 		r = midend_process_key(fe->me, x, y, MIDDLE_RELEASE);
+	if ( ((*lm)&2) &&  (m->buttons&2))
+		r = midend_process_key(fe->me, x, y, MIDDLE_DRAG);
 	if (!((*lm)&2) &&  (m->buttons&2))
 		r = midend_process_key(fe->me, x, y, MIDDLE_BUTTON);
 	if ( ((*lm)&4) && !(m->buttons&4))
 		r = midend_process_key(fe->me, x, y, RIGHT_RELEASE);
-	if (!((*lm)&4) &&  (m->buttons&2))
+	if ( ((*lm)&4) &&  (m->buttons&4))
+		r = midend_process_key(fe->me, x, y, RIGHT_DRAG);
+	if (!((*lm)&4) &&  (m->buttons&4))
 		r = midend_process_key(fe->me, x, y, RIGHT_BUTTON);
 	if (r >= 0) {
 	}