Bug 31973 - Turbo Vision doesn't handle mouse events correctly at 80x50
Summary: Turbo Vision doesn't handle mouse events correctly at 80x50
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-14 08:10 UTC by akm
Modified: 2001-11-24 18:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akm 2001-11-14 08:10:01 UTC
When putting the console into 80x50 the demo that comes with tvision,
detects mouse events on the wrong line (approx 1/2 the actual line
number).

As a result using menus or buttons in anything but 80x25 is impossible.

How-To-Repeat: run the tvision demo at higher console resolutions.
Comment 1 akm 2001-11-14 16:54:42 UTC
fbsdmHandle() in system.cc assumes the height divider 16 (hard coded 
constant).
I think if the screenHeight is > 25 it should be 8.

I'm not sure what the dividers should be for 132x60.
Comment 2 akm 2001-11-14 17:03:57 UTC
This seems to work for me.

--- work/tvision-0.7/lib/system.cc.orig Mon Sep 28 22:16:39 1998
+++ work/tvision-0.7/lib/system.cc      Thu Nov 15 03:00:19 2001
@@ -857,13 +857,20 @@
 {
        TEvent event;
        mouse_info_t mi;
+       int heightDivider=16;
 
        mi.operation = MOUSE_GETINFO;
        ioctl(STDOUT_FILENO, CONS_MOUSECTL, &mi);
+
+       if(TScreen::screenHeight > 25)
+       {
+               heightDivider=8;
+       }
+
        event.mouse.controlKeyState = kbReadShiftState();
        event.mouse.where.x = range(mi.u.data.x / 8, 0,
                TScreen::screenWidth - 1);
-       event.mouse.where.y = range(mi.u.data.y / 16, 0,
+       event.mouse.where.y = range(mi.u.data.y / heightDivider, 0,
                TScreen::screenHeight - 1);
 
        /* convert button bits to TV standard */
Comment 3 Ying-Chieh Liao freebsd_committer freebsd_triage 2001-11-24 18:09:41 UTC
State Changed
From-To: open->closed

committed, thanks