Closed cho934 closed 10 years ago
The button classes use the old sysfs devices, which were removed in recent ev3dev test releases.
Buttons are now implemented in the kernel as standard linux input devices. An example how to access these can be found in drive-test.cpp
in the function control::terminate_on_key()
.
I don't understand how "/dev/input/by-path/platform-gpio-keys.0-event" works exactly to detect each button. Have you got another explanation or a patch to modify the ev3dev-lang-demo.cpp / ev3dev.cpp?
Please take a look at this conversation, where @dlech explains the new approach: https://github.com/mindboards/ev3dev-kernel/issues/24. With this new approach my button classes do not work any longer, I need to change the concept. As soon as we have the next stable kernel release with a stable API, I will fix the button code.
Thanks a lot. Using the C code from @dlech, I modified the button class and I added 3 private properties. I modified also the pressed() function. So it works ! The command "close(fd);" is not yet implemented , maybe I can add it in the class destructor function... Where can I send you the update ? by email ? using a new comment ?
Simply create a branch in your local git repo, commit your changes and push the branch to GitHub. Then create a pull request on this branch, this enables me to review your changes and add them to my repo.
Sorry for the delay. The new code is now on my github and I created the pull request. https://github.com/cho934/ev3dev-lang
No problem with the delay. Thank you for your input.
All your requests are done.
Christophe.
2014-08-24 12:06 GMT+02:00 Franz Detro notifications@github.com:
No problem with the delay. Thank you for your input.
— Reply to this email directly or view it on GitHub https://github.com/fdetro/ev3dev-lang/issues/2#issuecomment-53186606.
Hello,
I've just tested this test, and it seems all buttons are always UP when I display the value. Can you try if you have the same problem ?
Best regards, Christophe