Is there any way to detect if a key is being held down while inside of the glutMouseFunc?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. Store a globally-accessible list of what keys are currently held down. Then read that list in your MouseFunc.
Note that the mouse callback already gets the control key state (shift/alt/ctrl), so you generally don’t need to do this.