Pointer Server (PtrServ) An AREXX Mouse Bully 2-Aug-91 Version 1.0 Copyright © 1991 by John Wiederhirn Kompositor Software All Rights Reserved This is my first release of this utility, whose sole purpose in life is to move the mouse pointer around in response to AREXX commands it receives. Sounds trivial, but for the types of software used in CDTV development, control of the pointer location often isnt available. Since all CDTV apps should follow the style guidelines for them, they need to do tricks like move the pointer from one menu item to another on a single click. This utility allows such to be done from within the likes of programs such as Inovatronic's CanDo (which was, incidentally, the inspiration). THE TERMS This program is freeware. While I reserve all of the rights, it may be distributed freely as long as this document accompanies the executable and neither has been altered. This program may be used in commercial or shareware products with the following limitation: If you do so, a copy of the product should be sent to me via one of the means listed in the section labelled "THE END OF THE STORY" at the end of this document. The intent here is that if the program does get used in other products, I get to see how its used. This is important to my being able to change the program without breaking existing uses. OTOH, if you do not follow this term, my lawyer isnt going to call your lawyer. But its a nice thing to do, ya know... Oh yeah, again, this is freeware, but any monetary donations are welcome using the US SNAIL address listed at the end of this document. INSTALLATION This program is more or less self-contained, so just put it where you want it and make sure you run it from there (obviously). Currently, the program relies on a couple of libraries/devices to be present: dos.library -+ exec.library | These are pretty safe bets. B) intuition.library -+ rexxsyslib.library -- It does use AREXX after all... input.device -- Cant really think of why this wouldnt be there Naturally, all of these have to be in their normal locations. STARTING THE PROGRAM Pretty darned simple, really. This program doesnt detach (yet), so you will probably want to run it as follows: RUN NIL: PtrServ The same applies when running it from within apps like CanDo. I suppose you can also run it from WorkBench, but for most of the apps which will be using this, its not that important. Once the program is run, it does some quick startup stuff and opens an AREXX port named "PTRSERVERn" for duty, where n is equal or greater than 1. The normal use will be PTRSERVER1. However, nothing prevents this code from being executed more than once, and as a result you can have a whole slew of PTRSERVER ports should you desire. You wont see much benefit from that, however, since they all simply feed events to the input.device, which basically serializes operation. THE COMMANDS PtrServ can take three commands via AREXX. Any other commands sent to it will simply return an error. The commands it accepts are as follows. ABS - Move the pointer to an absolute location Format: ABS Operation: When PtrServ gets this command, it relocates the mouse pointer to the coordinates given. Note that the coordinates are normalized screen coordinates based on a hires interlaced screen. The way this works on other screens is a little confusing at first, but thats the way intuition handles the mouse pointer location. If the or values are non-numeric or missing, they get set to zero. Setting either value too high will simply "max out" the mouse cursor at the appropriate screen edge. REL - Move the pointer relative to its current location Format: REL Operation: Does what you expect (with the caveat noted below). It moves the pointer from its current location. Either X or Y can be negative to make it move towards the left/top edge. As with ABS, values outside the screen simply cause the mouse to hit the edge and stop there. Just to spice things up, the coordinate system for this command uses the RAWMOUSE input event coordinates (sprite coordinates?). So the legal values here are different from the absolute coordinates discussed above. They seem to run akin to a 320w system for X, but y seems closer to 100h. You'll need to play with these a little to see what I mean. NOTE: Hopefully I can scale these babies (absolute and relative coordinates) so that the same numbers apply to both in the next version of this program. ANOTHER NOTE: From AREXX, you need to be aware of an ideosyncracy in how args get passed to commands for this command to work right with negative coordinates in . If this command is surrounded by quotes, everything will get passed to PtrServ as expected. If this command is used without quotes, and has a negative value, its not going to work like you think. For example, the following will work fine: 'REL 10 -5' but this will work differently than expected: REL 10 -5 The reason is quite simple. In the first example, the args get sent to PtrServ without AREXX taking a shot at em. In the second example, AREXX gets its greedy little hands on em, and evaluates the "10 -5" into "5". Not what many expect. The solution is simple: WHEN IN DOUBT, SURROND THE COMMAND AND ARGS IN QUOTES. QUIT - Kill off the PtrServ server Format: QUIT Operation: Pretty simple, you tell it to QUIT, it quits and dies. Any further AREXX messages sent to the port will cause errors when they cant find it, etc... THE STORY This baby was coded in a day. Well actually, the first version was coded from about 2pm on a Wednesday to 11pm. Then it was destroyed because I didnt like the way it was looking and it felt too big at 14K. Unfortunately, I was limited as to what I could do with that version because of how I had implemented the AREXX stuff, and it had to die. This one was coded from about 11:30pm Wednesday to 4am Thursday, and from 2pm Thursday till 3pm Thursday (not that anyone reading this cares). It feels much better size-wise (7K), and looks a little better inside. Time for some soapbox speaking. You saw how short it was to code this. Granted it doesnt have an elaborate AREXX interface, but to do so wouldnt take a _lot_ work. All of this thanks to Mike Sinz's little SimpleRexx routines, which make AREXX implementation really easy. There really isnt any reason to avoid AREXX ports, when you get right down to it. They dont take long, they're easy to code, and they make the software a lot more functional. If you dont need to have the program launch AREXX scripts, they're downright brutally easy to code. So do it. No more excuses. THE END OF THE STORY This program is barely a newborn. Tell me what you want, and Ill look into adding it. For now, I wanted to keep it small since CDTV doesnt sport a whole lot of spare RAM. If you have suggestions, comments, bug reports, etc, I can be reached as follows: BIX: jwiede -- I'm a moderator of a couple things here and this is where you'll get the quickest replies. CIS: 70164,1203 -- Im here once a week or so. If you send stuff here, it'll get to me, but it will take longer than if you send it via BIX. US SNAIL: John Wiederhirn 7 Rum Cherry Rd Ballston Spa, NY 12020 Its the mail, so dont expect speed... As I stated in the beginning of this text, this program is freeware. I reserve all of the rights, but give permission for the program to be distributed freely so long as this document accompanys it on the trip. Commercial/Shareware use of this product is subject to the terms listed in the section "THE TERMS" at the beginning of this document.