Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:37 10 Mar 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : pico hdmi usb mouse cursor

Author Message
tenij000
Senior Member

Joined: 30/05/2025
Location: Netherlands
Posts: 101
Posted: 12:36pm 08 Mar 2026
Copy link to clipboard 
Print this post

can mouse the mouse around then can see where it is by the numbers but dont have acursor if use circle for example it draws it all over the screen

is way to set picture as a background pic above that then maby i can delete old cursor pic if mouse moves
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1727
Posted: 01:35pm 08 Mar 2026
Copy link to clipboard 
Print this post

Sprites?
Regards
Michael
causality ≠ correlation ≠ coincidence
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 131
Posted: 01:57pm 08 Mar 2026
Copy link to clipboard 
Print this post

Check out the Paint program, maybe you can get some ideas.

https://www.thebackshed.com/forum/ViewTopic.php?TID=17589&PID=232395#232395

/Peter63
Edited 2026-03-09 00:05 by Peter63
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 131
Posted: 03:27pm 08 Mar 2026
Copy link to clipboard 
Print this post

Hello, tenij000
Test this program:
'
' Program: m-sprite.bas
' program to make a mouse sprite.
' Version: 2026-03-08 / Peter63
' used: PicoMiteHDMI MMBasic USB RP2350A Edition V6.02.01RC2
'
MODE 3
Font 1

' activate mouse cursor (create mouse-sprite file, if missing)
On error skip 1
Sprite load "mouse.spr",1,1
If MM.Errno Then
 Print "Mouse-sprite file created... wait..."
 make_sprite_mouse ' create mouse cursor
 Pause 3000
End If
Sprite load "mouse.spr",1,1

CLS
Color RGB(white),RGB(black)
Text 100,0," MOUSE-SPRITE TEST-PROGRAM ,  ESC=QUIT PROGRAM "
Text 100,16," USE LEFT MOUSE BUTTON, AND RIGHT MOUSE BUTTON "
xold=-9999:yold=-9999

' -------- MAIN LOOP: START  --------
Do

t=Asc(Inkey$)

' get mouse info
x=DEVICE(mouse 2,X)
y=DEVICE(mouse 2,Y)
lm=DEVICE(mouse 2,L) ' left mouse button
rm=DEVICE(mouse 2,R) ' right mouse button
mm=DEVICE(mouse 2,M) ' middle mouse button
dd=DEVICE(mouse 2,D) ' double click of the left mouse button

If xold<>x Or yold<>y Then ' show mouse on screen
 Sprite show 1,x,y,1
 xold=x:yold=y
End If

If lm Then ' check if left mouse button is pressed
 Sprite hide 1
 Circle x,y,20,1,1,RGB(red) ' print a circle to screen
 Sprite show 1,x,y,1
End If

If rm Then ' check if right mouse button is pressed
 Sprite hide 1
 Circle x,y,20,1,1,RGB(black),RGB(black) ' filled black circle
 Sprite show 1,x,y,1
End If


Loop Until t=27
' -------- MAIN LOOP: END  --------
End

' --- make a sprite mouse file "mouse.spr" ---
Sub make_sprite_mouse
Open "mouse.spr" As output For #1
Print #1,"16,1"
Print #1,"FFFFFF0000000000"
Print #1,"FF00000000000000"
Print #1,"F0F0000000000000"
Print #1,"F00F000000000000"
Print #1,"F000F00000000000"
Print #1,"F0000F0000000000"
Print #1,"000000F000000000"
Print #1,"0000000F00000000"
Print #1,"00000000F0000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Print #1,"0000000000000000"
Close #1
End Sub


/Peter63
 
tenij000
Senior Member

Joined: 30/05/2025
Location: Netherlands
Posts: 101
Posted: 03:43pm 08 Mar 2026
Copy link to clipboard 
Print this post

cool thx :)
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3064
Posted: 08:29pm 08 Mar 2026
Copy link to clipboard 
Print this post

  Quote  Open "mouse.spr" As output For #1
?
  manual said  Open "mouse.spr" For output As #1

But both work without error.

Edit.
"Pause 3000" can be reduced to "Pause 100" and still have time to spare.
Edited 2026-03-09 08:09 by phil99
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 131
Posted: 03:27pm 09 Mar 2026
Copy link to clipboard 
Print this post

Hello, phil99
Yep in "open" it should be As #1 and not For #1 as I have written.

One could also create the mouse.spr file every time without checking if it already exists. The program would be a bit shorter then, I think.

/Peter63
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026