summaryrefslogtreecommitdiff
path: root/contrib/keypad.enable/keypad.enable.diff
blob: 80643f0d7528205485364fd43c035edace6b8e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
*** pine/ttyout.c.REAL	Thu Dec 21 02:08:20 1995
--- pine/ttyout.c	Sat Feb 10 15:47:12 1996
***************
*** 131,137 ****
              *_startinsert, *_endinsert, *_insertchar, *_deletechar,
              *_deleteline, *_insertline,
              *_scrollregion, *_scrollup, *_scrolldown,
!             *_termcap_init, *_termcap_end;
  char  term_name[40];
  #ifndef USE_TERMINFO
  static char  _terminal[1024];         /* Storage for terminal entry */
--- 131,138 ----
              *_startinsert, *_endinsert, *_insertchar, *_deletechar,
              *_deleteline, *_insertline,
              *_scrollregion, *_scrollup, *_scrolldown,
!             *_termcap_init, *_termcap_end,
! 	    *_keypad_init, *_keypad_end;
  char  term_name[40];
  #ifndef USE_TERMINFO
  static char  _terminal[1024];         /* Storage for terminal entry */
***************
*** 228,233 ****
--- 229,236 ----
      _termcap_end       = tigetstr("rmcup");
      _lines	       = tigetnum("lines");
      _columns	       = tigetnum("cols");
+     _keypad_init       = tigetnum("smkx");
+     _keypad_end	       = tigetnum("rmkx");
      _ku                = tigetstr("kcuu1");
      _kd                = tigetstr("kcud1");
      _kl                = tigetstr("kcub1");
***************
*** 295,300 ****
--- 298,305 ----
      _termcap_end       = tgetstr("te", &ptr);
      _lines	       = tgetnum("li");
      _columns	       = tgetnum("co");
+     _keypad_init       = tgetstr("ks", &ptr);
+     _keypad_end	       = tgetstr("ke", &ptr);
      _ku                = tgetstr("ku", &ptr);
      _kd                = tgetstr("kd", &ptr);
      _kl                = tgetstr("kl", &ptr);
***************
*** 435,440 ****
--- 440,448 ----
  	BeginScroll(0, ps_global->ttyo->screen_rows);
  	fflush(stdout);
      }
+ 
+     if(_keypad_init)
+       tputs(_keypad_init, 1, outchar);
  }
          
  
***************
*** 510,515 ****
--- 518,526 ----
      MoveCursor(_lines - 2, 0);
      if(_termcap_end != NULL)
        tputs(_termcap_end, 1, outchar);
+ 
+     if(_keypad_end != NULL)
+       tputs(_keypad_end, 1, outchar);
  
      if(message){
  	StartInverse();
*** pico/tcap.c.REAL	Thu Dec 21 01:54:35 1995
--- pico/tcap.c	Sat Feb 10 16:08:47 1996
***************
*** 92,98 ****
  	*SF,			/* scroll text up */
  	*SR,			/* scroll text down */
  	*TI,			/* string to start termcap */
!         *TE;			/* string to end termcap */
  
  
  TERM term = {
--- 92,100 ----
  	*SF,			/* scroll text up */
  	*SR,			/* scroll text down */
  	*TI,			/* string to start termcap */
!         *TE,			/* string to end termcap */
! 	*KS,			/* string to enter application keypad mode */
! 	*KE;			/* string to end application keypad mode */
  
  
  TERM term = {
***************
*** 178,183 ****
--- 180,187 ----
      SR = tgetstr("sr", &p);
      TI = tgetstr("ti", &p);
      TE = tgetstr("te", &p);
+     KS = tgetstr("ks", &p);
+     KE = tgetstr("ke", &p);
  
      row = tgetnum("li");
      if(row == -1){
***************
*** 399,404 ****
--- 403,411 ----
  	if (CS)
  	  putpad(tgoto(CS, term.t_nrow, 0)) ;
      }
+ 
+     if(KS && !Pmaster)			/* enter app/keypad mode (cursor) */
+       putpad(KS);
  }
  
  
***************
*** 410,415 ****
--- 417,425 ----
  
  	if(TE)				/* any cleanup termcap requires */
  	  putpad(TE);
+ 
+ 	if(KE)
+ 	  putpad(KE);			/* end app/keypad mode */
      }
  
      kbdestroy(pico_kbesc);		/* clean up key board sequence trie */