shithub: riscv

Download patch

ref: 518fd3ec8350a010e5ed6490e1106c66af8f4d02
parent: 569bdd00c2d3df235ed42abce09d286f30e0edbd
author: cinap_lenrek <[email protected]>
date: Sun Nov 22 19:50:44 EST 2015

rio: stop serving kbdin file (thanks eekee)

kbdfs already provides a /dev/kbdin file for the system, rio does
not need to provide one for the onscreen keyboard anymore.

--- a/sys/src/cmd/rio/dat.h
+++ b/sys/src/cmd/rio/dat.h
@@ -7,7 +7,6 @@
 	Qwdir,
 	Qwinid,
 	Qwinname,
-	Qkbdin,
 	Qlabel,
 	Qkbd,
 	Qmouse,
--- a/sys/src/cmd/rio/fns.h
+++ b/sys/src/cmd/rio/fns.h
@@ -1,4 +1,3 @@
-void	keyboardsend(char*, int);
 int	whide(Window*);
 int	wunhide(Window*);
 void	freescrtemps(void);
--- a/sys/src/cmd/rio/fsys.c
+++ b/sys/src/cmd/rio/fsys.c
@@ -27,7 +27,6 @@
 	{ "consctl",	QTFILE,	Qconsctl,		0200 },
 	{ "winid",		QTFILE,	Qwinid,		0400 },
 	{ "winname",	QTFILE,	Qwinname,	0400 },
-	{ "kbdin",		QTFILE,	Qkbdin,		0200 },
 	{ "label",		QTFILE,	Qlabel,		0600 },
 	{ "kbd",	QTFILE,	Qkbd,		0600 },
 	{ "mouse",	QTFILE,	Qmouse,		0600 },
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -361,29 +361,6 @@
 	}
 }
 
-/*
- * Used by /dev/kbdin
- */
-void
-keyboardsend(char *s, int cnt)
-{
-	if(cnt <= 0)
-		return;
-	if(s[cnt-1] == 0)
-		chanprint(kbdchan, "%s", s);
-	else {
-		Rune r;
-		int nb;
-
-		nb = 0;
-		while(fullrune(s+nb, cnt-nb)){
-			nb += chartorune(&r, s+nb);
-			if(r != 0)
-				chanprint(kbdchan, "c%C", r);
-		}
-	}
-}
-
 int
 portion(int x, int lo, int hi)
 {
--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -257,12 +257,6 @@
 		}
 		w->ctlopen = TRUE;
 		break;
-	case Qkbdin:
-		if(w != wkeyboard){
-			filsysrespond(x->fs, x, &t, Eperm);
-			return;
-		}
-		break;
 	case Qkbd:
 		if(w->kbdopen){
 			filsysrespond(x->fs, x, &t, Einuse);
@@ -559,10 +553,6 @@
 		}
 		free(w->dir);
 		w->dir = cleanname(p);
-		break;
-
-	case Qkbdin:
-		keyboardsend(x->data, cnt);
 		break;
 
 	case Qwctl: