shithub: drawterm

Download patch

ref: cd0889fa95710264a8e6de18988559c31e089bba
parent: c0bdcc5a8543e1da29aa3fa584e6b8b7b27e1d5d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Feb 20 20:06:27 EST 2016

import keyboard.h from 9front, fix Kdel

--- a/gui-win32/screen.c
+++ b/gui-win32/screen.c
@@ -416,8 +416,7 @@
 			kbdputc(kbdq, Kins);
 			break;
 		case VK_DELETE:
-//			kbdputc(kbdq, Kdel);
-			kbdputc(kbdq, 0x7f);	// should have Kdel in keyboard.h
+			kbdputc(kbdq, Kdel);
 			break;
 		case VK_UP:
 			kbdputc(kbdq, Kup);
--- a/include/keyboard.h
+++ b/include/keyboard.h
@@ -1,8 +1,3 @@
-#ifdef PLAN9
-#pragma src "/sys/src/libdraw"
-#pragma lib "libdraw.a"
-#endif
-
 typedef struct 	Keyboardctl Keyboardctl;
 typedef struct	Channel	Channel;
 
@@ -18,27 +13,50 @@
 
 
 extern	Keyboardctl*	initkeyboard(char*);
-extern	int			ctlkeyboard(Keyboardctl*, char*);
-extern	void			closekeyboard(Keyboardctl*);
+extern	int		ctlkeyboard(Keyboardctl*, char*);
+extern	void		closekeyboard(Keyboardctl*);
 
 enum {
-    KF= 0xF000, /* Rune: beginning of private Unicode space */
-    Spec=   0xF800,
-    /* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
-    Khome=  KF|0x0D,
-    Kup=    KF|0x0E,
-    Kpgup=  KF|0x0F,
-    Kprint= KF|0x10,
-    Kleft=  KF|0x11,
-    Kright= KF|0x12,
-    Kdown=  Spec|0x00,
-    Kview=  Spec|0x00,  
-    Kpgdown=    KF|0x13,
-    Kins=   KF|0x14,
-    Kend=   KF|0x18,
+	KF=	0xF000,	/* Rune: beginning of private Unicode space */
+	Spec=	0xF800,
+	PF=	Spec|0x20,	/* num pad function key */
+	Kview=	Spec|0x00,	/* view (shift window up) */
+	/* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
+	Khome=	KF|0x0D,
+	Kup=	KF|0x0E,
+	Kdown=	Kview,
+	Kpgup=	KF|0x0F,
+	Kprint=	KF|0x10,
+	Kleft=	KF|0x11,
+	Kright=	KF|0x12,
+	Kpgdown=	KF|0x13,
+	Kins=	KF|0x14,
 
-    Kalt=       KF|0x15,
-    Kshift= KF|0x16,    
-    Kctl=       KF|0x17,
-};
+	Kalt=	KF|0x15,
+	Kshift=	KF|0x16,
+	Kctl=	KF|0x17,
 
+	Kend=	KF|0x18,
+	Kscroll=	KF|0x19,
+	Kscrolloneup=	KF|0x20,
+	Kscrollonedown=	KF|0x21,
+
+	Ksoh=	0x01,
+	Kstx=	0x02,
+	Ketx=	0x03,
+	Keof=	0x04,
+	Kenq=	0x05,
+	Kack=	0x06,
+	Kbs=	0x08,
+	Knack=	0x15,
+	Ketb=	0x17,
+	Kdel=	0x7f,
+	Kesc=	0x1b,
+
+	Kbreak=	Spec|0x61,
+	Kcaps=	Spec|0x64,
+	Knum=	Spec|0x65,
+	Kmiddle=	Spec|0x66,
+	Kaltgr=	Spec|0x67,
+	Kmouse=	Spec|0x100,
+};