Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor Control #60

Open
3tcubed opened this issue Feb 10, 2021 · 5 comments
Open

Cursor Control #60

3tcubed opened this issue Feb 10, 2021 · 5 comments

Comments

@3tcubed
Copy link

3tcubed commented Feb 10, 2021

Is there a way to turn the cursor on and off programmatically in pi3d?

I've reviewed source, and can't find an obvious method, here's what I've tried/investigated

I know you can turn it off when creating the display with DISPLAY_CONFIG_HIDE_CURSOR
but I want to turn it on again if a user hits a key sequence.

I tried setting DISPLAY.opengl.display_config = pi3d.DISPLAY_CONFIG_DEFAULT no luck
and tried defining and starting pi3d.Mouse still can't turn cursor back on

This is the last set of changes I had wanted to make before adding "PictureCalendar" (PictureFrame with Calendar functionality - Discussed with Wolfgang).

if I have to destroy the DISPLAY definition and start over it's not worth it

@paddywwoof
Copy link
Member

Well the hiding is done https://github.com/tipam/pi3d/blob/03e4e11ebd11ee05d907ae66e640e649761c680b/pi3d/util/DisplayOpenGL.py#L280 so that could be put into its own little function - I will look later to see what's involved with reversing it.

But it does occur to me that the relevant code is specific to an X11 display - on RPi3 and earlier without the desktop then I don't think there is a cursor at all. But there is a very simple pi3d.Gui system that you can see in the pi3d_demos Gui.py Which uses a little sprite as a cursor and you can toggle visibility of that simply by not doing draw(). That route might be more flexible but it might need a lot of re-writing for your mouse clicking functionality. Are you using a pi3d.Mouse?

Paddy

@paddywwoof
Copy link
Member

P.S. Timothy, I'm in the process of hacking the PictureFrame2020 code quite seriously as you will see on this Discussion thread. I don't know if that's relevant to your code or if it's too far off to be worth thinking about. The general objective has been to make it more modifiable...

@3tcubed
Copy link
Author

3tcubed commented Feb 10, 2021 via email

@3tcubed
Copy link
Author

3tcubed commented Feb 10, 2021 via email

@paddywwoof
Copy link
Member

Tim I think uploading to GitHub threads is very limited, probably only image files for the free accounts. You could upload it to your repo, or if you're not ready for that, email to patrick at eldwick dot org dot uk. I would certainly love to see your ideas, though if our code has diverged too much it may be quite a job to reincorporate everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants