Add support for non-auto release to button
authorAkos Kiss <akiss@inf.u-szeged.hu>
Sat, 10 Oct 2020 19:45:04 +0000 (21:45 +0200)
committerAkos Kiss <akiss@inf.u-szeged.hu>
Sat, 10 Oct 2020 19:45:04 +0000 (21:45 +0200)
commit7c551e09d6e85045ec1433717f9f8c36a6906725
tree05ebb66eda78a975950b968224f0495004ea808c
parent5c757546298c4c26022b3b4861e1bbfbdb72ac52
Add support for non-auto release to button

This allows better control of key press length, if needed.

To minimize negative effect on existng code, if the duration
argument of button_press is non-zero, functionality is kept as is
(i.e., using auto-release). If duration is set to zero, then button
will have to be explicitly released using a new API function,
button_release.

If simulation uses GLUT, it may make use of glutKeyboardUpFunc and
glutIgnoreKeyRepeat (in addition to glutKeyboardFunc found in
existing examples) to have more exact control over button presses
and releases.
examples/parts/button.c
examples/parts/button.h