XHC-WHB04-4 Python component

More
5 years 9 months ago #197093 by probotix
What if you had two buttons pressed, and released one. How could you know which one was released?

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #197121 by fixer
Replied by fixer on topic XHC-WHB04-4 Python component
What are you trying to do?
You can simply save the state of the pin you are interested in and compare it with the value of the said pin in the next iteration.

For a more Pythonic way investigate this:
stackoverflow.com/questions/51885246/cal...ble-change-in-python

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #197172 by probotix
Well, like for example, the function keys. You need to know that the Fn key was not released.

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #298242 by probotix
I've updated this to work with LinuxCNC 2.9+ and Python3. I also added the secondary function buttons that the original code was missing. I rather prefer this component over the built-in whb04b component *because* its written in python and I can easily modify it to do whatever I want. Thank you to the original author!

github.com/probotix/whb04

Enjoy!

 
The following user(s) said Thank You: fixer

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #298254 by fixer
Replied by fixer on topic XHC-WHB04-4 Python component
Great, thanks.
Make a pull request...

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum