QBasic Tutorial 55 - Mouse Interface Part 1 - Introduction to Mouse Input Programming - QB64


This tutorial shows how to get mouse input using QB64. This is a QB64 only program. QBasic 1.1 will not work.

Mouse Commands
_MOUSEX – X Coordinate
_MOUSEY – Y Coordinate
_MOUSEBUTTON(1) – Left Button
_MOUSEBUTTON(2) – Right Button
_MOUSEBUTTON(3) – Center Button
_MOUSEWHEEL – Mouse Wheel

When the mouse button function return -1, we know that the mouse button was clicked. When the mouse button function is 0, we know that the mouse button was not clicked.

The mouse wheel function returns -1 for scrolling up, 1 for scrolling down and 0 for no wheel movement.

Code Download
QBT55.BAS * QB64 Only



QBasic / QB64 Links

QB64 is a free download at www.qb64.com

QB64 Wiki & Manual is found at qb64.com/wiki.html

QBasic 1.1 comes with OldDOS. A zip file of OldDOS can be found at www.pcxt-micro.com/download.html

QBasic 1.1 needs DOSBox to run on Windows Vista and greater, Mac, and Linux.
DosBox is a free download at www.dosbox.com

Free QB64/QBasic Code

QBasic.Net - www.qbasic.net

Pete's QBasic Site - www.petesqbsite.com/index.php

QB45 - qb45.org

Phatcode - games.phatcode.net