Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mapping screen for mouse
#4
Some code aids could help for that double-dimensional array like so:

Code: (Select All)
CONST XTOPLEFT = 1, YTOPLEFT = 2, XBOTRIGHT = 3, YBOTRIGHT = 4, WHICHOPT = 5

then one of the sections to initialize could be written like this:

Code: (Select All)
mousesector(2, XTOPLEFT) = 321 'xi
mousesector(2, YTOPLEFT) = 1 'yi
mousesector(2, XBOTRIGHT) = 639 'xf
mousesector(2, YBOTRIGHT) = 480 'yf
mousesector(2, WHICHOPT) = 2 'option selected

Taking this further, it could be changed so it could respond to right mouse button instead of the left, or a different mouse button. But most people have three-button devices (including pressing down on mouse wheel).

This example could also be modified so that specific buttons are drawn on the screen and the program responds differently to one or the other being touched with the left mouse button. Use the "mousesector" information to draw the bounding box of the button on display.

EDIT: Sorry, had to completely rewrite it, it was more confusing. I wanted to use "TOPLEFT", "TOPRIGHT", "BOTLEFT", "BOTRIGHT" but it would have required pairs of coordinates rather than just X or Y for one point of the bounding rectangle.
Reply


Messages In This Thread
Mapping screen for mouse - by PhilOfPerth - 08-07-2023, 01:52 AM
RE: Mapping screen for mouse - by commandvom - 08-07-2023, 02:32 AM
RE: Mapping screen for mouse - by mnrvovrfc - 08-07-2023, 03:36 AM
RE: Mapping screen for mouse - by mnrvovrfc - 08-07-2023, 03:51 AM
RE: Mapping screen for mouse - by PhilOfPerth - 08-07-2023, 04:14 AM
RE: Mapping screen for mouse - by SMcNeill - 08-07-2023, 07:25 AM
RE: Mapping screen for mouse - by PhilOfPerth - 08-08-2023, 06:53 AM
RE: Mapping screen for mouse - by TerryRitchie - 08-07-2023, 08:36 AM
RE: Mapping screen for mouse - by grymmjack - 08-07-2023, 02:32 PM
RE: Mapping screen for mouse - by TerryRitchie - 08-07-2023, 03:29 PM
RE: Mapping screen for mouse - by grymmjack - 08-08-2023, 12:12 AM
RE: Mapping screen for mouse - by TerryRitchie - 08-08-2023, 05:10 PM
RE: Mapping screen for mouse - by bplus - 08-07-2023, 02:36 PM
RE: Mapping screen for mouse - by TerryRitchie - 08-07-2023, 03:34 PM
RE: Mapping screen for mouse - by CharlieJV - 08-07-2023, 09:37 PM
RE: Mapping screen for mouse - by grymmjack - 08-08-2023, 12:17 AM
RE: Mapping screen for mouse - by CharlieJV - 08-08-2023, 01:53 AM
RE: Mapping screen for mouse - by grymmjack - 08-08-2023, 12:11 AM
RE: Mapping screen for mouse - by mnrvovrfc - 08-08-2023, 12:37 PM
RE: Mapping screen for mouse - by bplus - 08-07-2023, 05:44 PM
RE: Mapping screen for mouse - by justsomeguy - 08-07-2023, 07:55 PM
RE: Mapping screen for mouse - by CharlieJV - 08-07-2023, 09:35 PM
RE: Mapping screen for mouse - by grymmjack - 08-08-2023, 12:07 AM
RE: Mapping screen for mouse - by mdijkens - 08-08-2023, 10:24 AM
RE: Mapping screen for mouse - by bplus - 08-07-2023, 08:47 PM
RE: Mapping screen for mouse - by justsomeguy - 08-07-2023, 09:16 PM
RE: Mapping screen for mouse - by justsomeguy - 08-07-2023, 09:22 PM
RE: Mapping screen for mouse - by CharlieJV - 08-07-2023, 09:46 PM
RE: Mapping screen for mouse - by justsomeguy - 08-07-2023, 10:03 PM
RE: Mapping screen for mouse - by CharlieJV - 08-07-2023, 10:57 PM
RE: Mapping screen for mouse - by bplus - 08-07-2023, 11:37 PM
RE: Mapping screen for mouse - by TerryRitchie - 08-08-2023, 02:45 AM
RE: Mapping screen for mouse - by PhilOfPerth - 08-08-2023, 06:59 AM
RE: Mapping screen for mouse - by bplus - 08-08-2023, 12:25 PM
RE: Mapping screen for mouse - by mdijkens - 08-08-2023, 01:16 PM
RE: Mapping screen for mouse - by justsomeguy - 08-08-2023, 06:59 PM



Users browsing this thread: 19 Guest(s)