You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 docursor.is_alt_clicked
and it will return true if the (B) button is pressed essentially the same way thatis_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.
The text was updated successfully, but these errors were encountered: