home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / NCSATELN / TEL23SRC.ZIP / ENGINE / MOUSE.C < prev    next >
Encoding:
Text File  |  1991-06-23  |  3.7 KB  |  91 lines

  1. /*  Mouse routines for NCSA Telnet */
  2. /* Andrew Tridgell 10/17/90 */
  3.  
  4. /* Basically these can replace n_chkchar,n_getchar and n_scrlck
  5.    with ones that do the following
  6.  
  7.     mouse up : up arrow
  8.     mouse down : down arrow
  9.     mouse right : right arrow
  10.     mouse left : left arrow
  11.  
  12.     left button : space bar
  13.     right button : scroll lock toggle
  14.  
  15.   This is achieved by including mouse.h
  16. */
  17.  
  18. #define MOUSE_H
  19.  
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include "nkeys.h"
  23. #include "externs.h"
  24.  
  25. #ifdef MSC 
  26. #define mousecl mousecml 
  27. #endif 
  28.  
  29. int nm_getchar(void);
  30. int nm_chkchar(void);
  31. int nm_scrlck(void);
  32. int nm_chkmouse(void);
  33. int nm_initmouse(void);
  34. int nm_mousespeed(int change);
  35.  
  36. extern int use_mouse;
  37. extern int ginon;
  38.  
  39. struct     {
  40.     int speed,
  41.         num_right,
  42.         num_down;
  43.     unsigned int installed:1,    /* boolean, whether the mouse has been installed */
  44.         left_flag:1,            /* boolean, whether the left button is down */
  45.         right_flag:1,            /* boolean, whether the right button is down */
  46.         scrlck:1;                /* boolean, whether the scrl-lock is active */
  47.   } mouse;
  48.  
  49. #ifdef GETtiveright]∩≥╣α"ên i│ên iêª░S1,    /* boolean, whether the mouse has been installed */
  50.         leftα"se;
  51. 
  52.     extáiêªzris a#┼%$dag:1,    τlyy whet╣ì╛0╨ë╥    τlyë╔ht,
  53.  
  54. ther the scrCSAvn, whwhwhwëⁿ╞«7owy whet╣ì╛0╨ë
  55.         l0 */τⁿght_flag:1┘¬─╠êean, whude "n
  56. ex#x#x#x#x#xêThis ┐ speed,0╨ë */τⁿ_ÿlag:1,▌╥;
  57. ag:1Γkmou▓Θ#x#E_ⁿm_nThiousag:1,▌╥ou▓Θ#òªe "nght_╜ThiousfÉfú#: up aight arái¬f
  58. ₧wëaight║
  59. °:i≤ the ░ thentive *wnpEk'W{█πag:1,    τlìbooleanäS0╨ëí╤£aH4Ωnm_getf
  60. ₧wëaighé=Jhtµóousll 10/17/90 *|ß This is achie/17/90 *non;
  61. ùGΘΩ3╧é╣ght_flag
  62. ùG[ightµj/17/90 *òGΘ
  63. [ thentive *wnpEk'W{█πag:1,    τlìbooleanäS0╨ëí╤£aH4Ωnm_getf
  64. ₧wëaighé=Jhtµóousll 10/17/90 *|ß This is achie/17/90 *non;
  65. ùGΘΩ3╧é╣ght_flag
  66. ùG[ightµj/17/90 *òGΘ
  67. [:1,    τlìbo7/9╞1,    τ:1,    τ
  68. is non;unsigned∩ª then¡0╨.:1,    τl²GΘ
  69. [Θ
  70. [π√ighBY$ T/*  Mouse routines for NCSA Telnet */
  71. /* Andrew Tridgell 10/17/90 */
  72.  
  73. /* Basically these can replace n_chkchar,n_getchar and n_scrlck
  74.    with ones that do the following
  75.  
  76.     mouse up : up arrow
  77.     mouse down : down arrow
  78.     mouse right : right arrow
  79.     mouse leftàgight : right arrow
  80.     mouse leftàgikcha mouse has been insCbe
  81. ùG[ighttru¢µn : doow
  82. ⁿf
  83. ₧wëf
  84. ¼fëç╖  with ones ight : riheCURRTarrow
  85. µn : doow
  86. ⁿ<=₧wëf
  87. ¼fëç+  with ones ight : riheCURLFarrow
  88. µf
  89. ₧wë╖  with ones iht : riheCURDNchar and n_scrlck
  90.   <=₧wë/90 *non;with ones iht : riheCURUPchar and n_scrlck
  91.    S0╨ë thentive *w/17/90 * Ω3╧é╣0ght_flght3flghtightle    µj/17/90 *òespeed(intg:1,    τlìboouse hwith ones ou0/1