View full-text article in PMC Sensors (Basel). 2024 Feb 18;24(4):1308. doi: 10.3390/s24041308 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2 DetectEvent algorithm Require: N≥2Require: xz action performed by the player at the iteration z 1:ys← ‘Standing’ 2:yw← ‘Walking’ 3:events_list← [] 4:id_event←0 5:current_state←0 6:while i≤N do 7: if xi=ys or xi=yw then 8: if current_state=1 then 9: id_event←id_event+1 10: events_list[i]←id_event 11: end if current_state=0 12: events_list[i]←id_event 13: current_state←1 14: end if xi≠ys and xi≠yw 15: events_list[i]←id_event 16: current_state←0 17:end while