Mouse position: Difference between revisions
Content added Content deleted
(add FreeBASIC) |
|||
Line 523: | Line 523: | ||
<border-button> gadget. ; |
<border-button> gadget. ; |
||
</lang> |
</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}}== |
=={{header|Gambas}}== |