Posts: 2,698
Threads: 328
Joined: Apr 2022
Reputation:
217
This is one of those keywords of the day that Steve(tm) personally thinks is written poorly. Sure, it works, but in my opinion, it works backwards half the time. Let me explain in a moment, after I get the basics out of the way:
What is it? _Mousemove is simply a command to move the mouse cursor across your screen. It's not hard to figure out what this one does.
How does on use it? Simply add in a command for _MOUSEMOVE (x, y), and move that mouse cursor where you want it to go.
Now, why do it personally think it's poorly written?
Code: (Select All) For y = 1 To _Height
For x = 1 To _Width
Locate y, x: Print "ð";
_MouseMove x, y
_Limit 80
Next
Next
Sleep
In the code above, we're using _MOUSEMOVE with a SCREEN 0 text screen. _MOUSEMOVE here is moving by character position -- but if you look closely at the code above, you'll see that we're locating y, x and mousemoving x, y. In my opinion, if you're going to have a set coordinate system for a certain screen mode, then you need to stick to that existing coordinate system!
It's just a PITA to have to remember to swap over from row, column coordinates to width, height coordinates. Honestly, I think this may have been some sort of oversight when the code was originally written, but it's too late to change it now. Who knows how much old code might be broken by the swap? For better or worse, _MOUSEMOVE now will always run in width, height coordinates -- even in SCREEN 0 screens where we normally think in terms of row, column.
Be aware of this backwards coordinate system and don't like it bit you on the hiney, if you're ever coding in SCREEN 0. It's just one small aspect of an otherwise simple command to always keep in the back of your mind when working with it.
Posts: 1,581
Threads: 59
Joined: Jul 2022
Reputation:
52
(11-17-2022, 11:08 PM)SMcNeill Wrote: It's just a PITA to have to remember to swap over from row, column coordinates to width, height coordinates. Honestly, I think this may have been some sort of oversight when the code was originally written, but it's too late to change it now. Who knows how much old code might be broken by the swap? For better or worse, _MOUSEMOVE now will always run in width, height coordinates -- even in SCREEN 0 screens where we normally think in terms of row, column.
Be aware of this backwards coordinate system and don't like it bit you on the hiney, if you're ever coding in SCREEN 0. It's just one small aspect of an otherwise simple command to always keep in the back of your mind when working with it. Whoever created this statement, if not Galleon belonged to the "old school" of being "married" to SCREEN 0 and being less keen about graphics screen on their very slow 16-bit systems. I'm still seeing "SCREEN 9" and such around here, that's what I mean. Because "LOCATE" enforces so much by character position, in SCREEN 0 then any other command is expected to be limited along those guidelines. In fact, the order of (X,Y) coordinates is wrong for "_MOUSEMOVE", it should be row then column, like "LOCATE".
If "_MOUSEMOVE" is to be fixed then you guys would have to fix "_NEWIMAGE()" as well; I think this is the real barrier.
Remember in the 1980's that "mouse support" had to be enabled through a driver that M$ wrote, and a version of it was supplied for Borland language products. The mouse was an afterthought until people caught on to Macintosh OS and Windows being slicker than MS-DOS and learning as many keystroke shortcuts as possible LOL like it had to be done with Wordstar, WordPerfect, Lotus123 and many other office apps back in the day.
Posts: 653
Threads: 96
Joined: Apr 2022
Reputation:
22
I've never used mouse actions before, so I'm struggling a bit. When I run your code, the cursor moves continually, left to right, down the screen, and moving my mouse has little effect on this. It seems to "jiggle" the cursor up one o two pixels, then continues on. Do I need a mouse-driver file or something?
Posts: 1,581
Threads: 59
Joined: Jul 2022
Reputation:
52
(11-17-2022, 11:21 PM)PhilOfPerth Wrote: I've never used mouse actions before, so I'm struggling a bit. With "_MOUSEMOVE" the mouse cursor is moved for you. Steve's program was for demonstration purposes only.
Posts: 2,183
Threads: 222
Joined: Apr 2022
Reputation:
104
Oh big deal. Do it my way, like a true professional!
Code: (Select All) SWAP y, x: _MOUSEMOVE y, x: SWAP y, x
I totally agree, complete PITA.
It's a very handy command if you use it to set the mouse cursor in a desired local after an event, but almost all the time users prefer to control the mouse on their own.
I haven't found it to be too useful if used as a limiting function. Say you are trying to highlight text with a mouse function. You are better off writing a routine to handle the racing issues, like I did for Sam Clip and my WP routines, than to try to take control of the mouse by using _MOUSEMOVE to set the mouse cursor only after the line is highlighted.
Pete
Posts: 1,581
Threads: 59
Joined: Jul 2022
Reputation:
52
11-17-2022, 11:36 PM
(This post was last modified: 11-17-2022, 11:38 PM by mnrvovrfc.
Edit Reason: LOL tricked myself
)
"SWAP" wasn't needed... you'll still have to write "_MOUSEMOVE x, y" if you're going to use "SWAP" twice like that.
(facepalm) never mind.
Posts: 2,698
Threads: 328
Joined: Apr 2022
Reputation:
217
(11-17-2022, 11:25 PM)Pete Wrote: Oh big deal. Do it my way, like a true professional!
Code: (Select All) SWAP y, x: _MOUSEMOVE y, x: SWAP y, x
I totally agree, complete PITA.
It's a very handy command if you use it to set the mouse cursor in a desired local after an event, but almost all the time users prefer to control the mouse on their own.
I haven't found it to be too useful if used as a limiting function. Say you are trying to highlight text with a mouse function. You are better off writing a routine to handle the racing issues, like I did for Sam Clip and my WP routines, than to try to take control of the mouse by using _MOUSEMOVE to set the mouse cursor only after the line is highlighted.
Pete
The only time I've found it useful is if I'm writing a demo program and want to move the mouse for the user to follow along visually with what I'm talking about.
PRINT "And here, in the top left corner of the screen, we see the rare Ooga-Booga.."
_MOUSEMOVE 10,10
_DELAY .25
PRINT "And, if you follow us over to the right side of the screen, and look behind the edge of the tree there, you'll see the elusive Petey Pooper..."
_MOUSEMOVE 1000, 250
_DELAY .25
....
If you move the mouse in a delayed loop, people are visual creatures -- you can easily draw their attention to wherever you want it to be on the screen, with very little effort.
Posts: 2,183
Threads: 222
Joined: Apr 2022
Reputation:
104
I'll have you know where I live, we enjoy INDOOR plumbing! Oops, I almost forgot, It's Thursday, time to move the outhouse from the living room to the den.
Pete
|