shithub: acme

Download patch

ref: fc221bab2ca5b2dff5df4db9a1e9845954e1473f
parent: f725a9d662c423d818cc6cab01b58b2c104da2b9
author: glenda <glenda@cirno>
date: Tue Apr 1 16:35:34 EDT 2025

set up reverse look3 with ctl

--- a/acme.c
+++ b/acme.c
@@ -409,6 +409,7 @@
 		case KKey:
 			if(*s == 'k' || *s == 'K') {
 				shiftdown = utfrune(s+1, Kshift) != nil;
+				ctldown = utfrune(s+1, Kctl) != nil;
 				free(s);
 				break;
 			}
@@ -469,9 +470,6 @@
 	if((kfd = open("/dev/kbd", OREAD)) >= 0){
 		close(fd);
 
-		/* only serve a kbd file per window when we got one */
-		servekbd = 1;
-
 		/* read kbd state */
 		while((n = read(kfd, buf, sizeof(buf)-1)) > 0){
 			e = buf+n;
@@ -667,9 +665,10 @@
 				}else if(m.buttons & 2){
 					if(textselect2(t, &q0, &q1, &argt))
 						execute(t, q0, q1, FALSE, argt);
-				}else if(m.buttons & (4|(4<<Shift))){
-					if(textselect3(t, &q0, &q1))
-						look3(t, q0, q1, FALSE, (m.buttons&(4<<Shift))!=0);
+				}else if(m.buttons & 4){
+					if(textselect3(t, &q0, &q1)){
+						look3(t, q0, q1, FALSE, ctldown);
+					}
 				}
 				if(w)
 					winunlock(w);
--- a/dat.h
+++ b/dat.h
@@ -8,7 +8,6 @@
 	Qeditout,
 	Qindex,
 	Qlabel,
-	Qkbd,
 	Qlog,
 	Qnew,
 
@@ -55,9 +54,7 @@
 typedef	struct	Timer Timer;
 typedef	struct	Window Window;
 typedef	struct	Xfid Xfid;
-typedef struct	Kbdreadmesg Kbdreadmesg;
 
-
 struct Runestr
 {
 	Rune	*r;
@@ -282,8 +279,6 @@
 	int		tagexpand;
 	int		taglines;
 	Rectangle	tagtop;
-	Channel		*ck;		/* chan(char*) */
-	uchar	kbdopen;
 };
 
 void	wininit(Window*, Window*, Rectangle);
@@ -562,9 +557,8 @@
 int			messagesize;		/* negotiated in 9P version setup */
 int			globalindent[NINDENT];
 Rune		*delcmd;			/* what command deleted the window. eg, Del, Delete, Delmesg */
-Window		*input;
-int			servekbd;
 int			shiftdown;
+int			ctldown;
 
 Channel	*cplumb;		/* chan(Plumbmsg*) */
 Channel	*cwait;		/* chan(Waitmsg) */
@@ -579,7 +573,5 @@
 Channel	*cerr;		/* chan(char*) */
 Channel	*cedit;		/* chan(int) */
 Channel	*cwarn;		/* chan(void*)[1] (really chan(unit)[1]) */
-Channel	*kbdread;	/* chan(Consreadmesg) */
-
 
 #define	STACK	8192