I have a simple opengl based game, it is controlled using arrow keys. I want to control it using my hand gestures. I have made an opencv program which tells the direction of my finger. How do I integrate the two codes so that I can control my game using my finger? I have used multithreading but it has not worked and I am not sure if multithreading is the right way for this problem. Please guide.