How to Use a Mouse in Your QBASIC Programs

Written by joshua laud
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Use a Mouse in Your QBASIC Programs
You must enter two lines of code to enable your mouse in QBasic. (Burke/Triolo Productions/Brand X Pictures/Getty Images)

QBasic is based upon the QuickBASIC programming language developed primarily for Microsoft Disk Operating System (MS-DOS) computers. As QBasic -- and QuickBASIC -- are developed for DOS, you do not by default have the ability to use the mouse. The computer mouse was first properly implemented in the Windows operating systems. Therefore, if you want to use a mouse in a QBasic program, you have to insert two lines of code to include it.

Skill level:


  1. 1

    Open your QBasic script in whichever script editor you are using.

  2. 2

    Scroll to the top of your script and put the following code in:


    DECLARE SUB Mouse (Funk)

    The first line enables the default variables and the second line declares the mouse function within the script.

  3. 3

    Save your script.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.