Jump to content

Mouse position: Difference between revisions

add FreeBASIC
(add FreeBASIC)
Line 523:
<border-button> gadget. ;
</lang>
 
=={{header|FreeBASIC}}
<lang freebasic>
type MOUSE
'mouse position, button state, wheel state
x as integer
y as integer
buttons as integer
wheel as integer
end type
 
screen 12
 
dim as MOUSE mouse
 
while inkey=""
locate 1,1
getmouse(mouse.x, mouse.y, mouse.wheel, mouse.buttons)
if mouse.x < 0 then
print "Mouse out of window. "
print " "
print " "
else
print "Mouse position : ", mouse.x, mouse.y, " "
print "Buttons clicked: ";
print Iif( mouse.buttons and 1, "Left ", " " );
print Iif( mouse.buttons and 2, "Right ", " " );
print Iif( mouse.buttons and 4, "Middle ", " " )
print "Wheel scrolls: ", mouse.wheel," "
end if
wend</lang>
 
=={{header|Gambas}}==
781

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.