Sunday 22 November 2015

Help with Process.stdin Event Listening

Hello, I have limited knowledge on coding with node.js, and am wondering if it is possible to "listen for nothing"... I am not sure how else to put it. I will explain my situation- So right now I am trying to program the AR2 Drone with the node.js library. I have listener code set up to listen for continuous keypresses of WASD, moving the drone accordingly (used the following: http://ift.tt/1jeSXRh Response from Peter Lyon using keypress module) However, I cannot figure out how to do the following: when the keys are released/nothing is being pressed, the drone stays in a hovering state. My janky infinite while loops did not work, and right now I can only make it that you press a key and then it hovers. Is it possible to set a new listener that listens for.. no events I guess? I mean -> if no key pressed, drone stay hovering. Am I missing any function that could easily simplify this? If necessary, I post my code of the keypress listener I set up, but its a bit long

Submitted November 22, 2015 at 10:47PM by bluereborn

No comments:

Post a Comment