• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Mouse in Applesoft BASIC

Does anybody know how to access mouse movements (and maybe even the button! That would be wondrous!) in Applesoft BASIC? I know how to do the joystick, but I'm unsure about how to get the mouse. This would really make some little apps more fun and interesting.

 
Hear that sound? That was my brain asploding :p

Is there an easier way? I know that to do things with the joystick in BASIC you use "pdl", but isn't there something like that for the mouse?

 
Depends what slot you have it in. Say you have it in slot 4, then try using IN #4 and then loop over INPUT X,Y,B and PRINT X, Y, B or something like that and see if you get the desired values.

Edit: I just had a try with an emulator, but couldn't get it to work. Might have more luck remembering the details on my real machine at home (with a couple of books to refer to!)

 
Try searching comp.sys.apple2 and comp.sys.apple2.programmer on Google Groups... there's a bit of useful info on there.

 
Hear that sound? That was my brain asploding :p
http://your.head.asplode.net/

Is there an easier way? I know that to do things with the joystick in BASIC you use "pdl", but isn't there something like that for the mouse?
No, not built in. The paddle interface was there since day 1 of the Apple II, but the mouse card came much, much later. Long after BASIC updates had ceased. It wouldn't surprise me if there are extensions out there, but I'm not aware of any.

 
Luddite: Thanks, I'll have to poke around in there a bit :)

Dave: Alrightey, thanks for confirming what I had thought but not hoped for :( I'll keep looking around though.

 
Back
Top