Skip to content

Could provide "alt click" functionality #29

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

Closed
FoamyGuy opened this issue Dec 13, 2021 · 1 comment · Fixed by #32
Closed

Could provide "alt click" functionality #29

FoamyGuy opened this issue Dec 13, 2021 · 1 comment · Fixed by #32

Comments

@FoamyGuy
Copy link
Contributor

On the PyGamer many (or possibly all) of the buttons are connected to the main chip via some sort of IO Expander device. It seems that only one thing at a time can have this device initialized and be able to check the states of the buttons.

I ran into a situation where I want to be able to take different action when the (B) button is clicked vs. the action taken when the (A) button is clicked. But currently this library only provides the single is_clicked which is mapped to the (A) button only.

Since the library has initialized the IO Expander my user code is unable to initialize it and check the state of the (B) button.

To make it work for my use case I added an is_alt_clicked property to this library that is mapped to the (B) button. This way after initializing cursor control I can do cursor.is_alt_clicked and it will return true if the (B) button is pressed essentially the same way that is_clicked works today for the (A) button.

I will PR my solution for it this week, but wanted to get the issue created to see if anyone else has thoughts or ideas about best way to solve for this use case.

@tekktrik
Copy link
Member

tekktrik commented Dec 15, 2021

I think this makes sense, having multiple properties for each button. I also think is_alt_clicked is a good name for it, the only other option that makes sense to me would be to make it is_b_clicked and rename the other to is_a_clicked but it's not backwards compatible and I'm not convinced it's particularly better/clearer then the other.

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

Successfully merging a pull request may close this issue.

2 participants