aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-14 04:58:02 +0000
committerRichard M. Stallman1994-07-14 04:58:02 +0000
commite118d5efd59dc14c9cdc9bdf79665804cdc8842c (patch)
treebddde22cf4b75b1298efd8e2ed9b42ac8fd5a278 /src/msdos.c
parenta9c95e08a1a1f8c6b2e8a42808c4bdfceeb03aa7 (diff)
downloademacs-e118d5efd59dc14c9cdc9bdf79665804cdc8842c.tar.gz
emacs-e118d5efd59dc14c9cdc9bdf79665804cdc8842c.zip
(mouse_init1): Use alternate mouse detection for old mouse drivers.
(mouse_get_pos): Downscale coordinates by 8.
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 6c72853143a..55d2fc27490 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1147,8 +1147,8 @@ mouse_get_pos (f, bar_window, part, x, y, time)
1147 *f = selected_frame; 1147 *f = selected_frame;
1148 *bar_window = Qnil; 1148 *bar_window = Qnil;
1149 gettimeofday (&tv, NULL); 1149 gettimeofday (&tv, NULL);
1150 *x = make_number (regs.x.cx); 1150 *x = make_number (regs.x.cx / 8);
1151 *y = make_number (regs.x.dx); 1151 *y = make_number (regs.x.dx / 8);
1152 *time = tv.tv_usec; 1152 *time = tv.tv_usec;
1153 mouse_moved = 0; 1153 mouse_moved = 0;
1154} 1154}
@@ -1174,9 +1174,22 @@ mouse_init1 ()
1174 union REGS regs; 1174 union REGS regs;
1175 int present; 1175 int present;
1176 1176
1177 if (!internal_terminal)
1178 return 0;
1179
1177 regs.x.ax = 0x0021; 1180 regs.x.ax = 0x0021;
1178 int86 (0x33, &regs, &regs); 1181 int86 (0x33, &regs, &regs);
1179 present = internal_terminal && (regs.x.ax & 0xffff) == 0xffff; 1182 present = (regs.x.ax & 0xffff) == 0xffff;
1183 if (!present)
1184 {
1185 /* Reportedly, the above doesn't work for some mouse drivers. There
1186 is an additional detection method that should work, but might be
1187 a little slower. Use that as an alternative. */
1188 regs.x.ax = 0x0000;
1189 int86 (0x33, &regs, &regs);
1190 present = (regs.x.ax & 0xffff) == 0xffff;
1191 }
1192
1180 if (present) 1193 if (present)
1181 { 1194 {
1182 if (regs.x.bx == 3) 1195 if (regs.x.bx == 3)