Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to get the key state, but my program is always getting a line, so the getkeystate doesn't recognize the key getting clicked, anyways to fix that?

example of the sort of thing pseudo-code: if(getkey("x")){\\do stuff}getline(cin,str)
how do I get both the getkey to also activate when a specific key is pressed? instead of it just not working

What I have tried:

i've tried replacing getline with getkeystate, makes code way way too slow, so what should I do?
Posted
Comments
[no name] 1-Jan-22 14:27pm    
I don't think you "get a char" and then test for a state; it all happens at the same time: key down + shift down + alt down + ctrl down + mouse down right / left + ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900