Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
71
Task/Mouse-position/Pebble/mouse-position.pebble
Normal file
71
Task/Mouse-position/Pebble/mouse-position.pebble
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
;mouse demonstration
|
||||
;compile with Pebble
|
||||
;for textmode x86 DOS
|
||||
;requires mouse driver
|
||||
|
||||
program examples\mouse
|
||||
|
||||
use mouse.inc
|
||||
|
||||
data
|
||||
|
||||
int mousex[0]
|
||||
int mousey[0]
|
||||
int mouseb[0]
|
||||
int speed[0]
|
||||
int i[0]
|
||||
|
||||
begin
|
||||
|
||||
echo "Enter 1-200 for slow/DOS/emulated machines."
|
||||
echo "Enter 500-20000 for faster/Windows machines."
|
||||
input [speed]
|
||||
|
||||
cls
|
||||
|
||||
call showmouse
|
||||
|
||||
label mainloop
|
||||
|
||||
;clear mouse coordinates
|
||||
|
||||
cursor 0, 0
|
||||
echo " "
|
||||
echo " "
|
||||
|
||||
;get and display mouse coordinates
|
||||
|
||||
call readmouse
|
||||
|
||||
cursor 0, 0
|
||||
echo [mousey]
|
||||
crlf
|
||||
echo [mousex]
|
||||
|
||||
;display exit button
|
||||
|
||||
cursor 76, 0
|
||||
echo "[X]"
|
||||
|
||||
;check if exit button has been clicked
|
||||
|
||||
if [mouseb] = 1 & [mousex] >= 76 & [mousex] <= 79 & [mousey] = 0 then
|
||||
|
||||
kill
|
||||
|
||||
endif
|
||||
|
||||
;loop 100 times since some machines do not support the WAIT command
|
||||
|
||||
[i] = 0
|
||||
|
||||
label delay
|
||||
|
||||
+1 [i]
|
||||
wait 1
|
||||
|
||||
if [i] < [speed] then delay
|
||||
|
||||
goto mainloop
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue