Did you try
If 1=true then 0=false,Key1=1,if hit,Key1=0,if hitx2,
/idk what i'm talking about.
I don't think Im the only one who has been seeing this a lot lately:
Now I don't know how in the world this could work, but some how it is returning true when some people press the correct key, when in reality it should always return false. I know some of you are like: "Well if it works who cares?", but this is a problem it shows a serious inconsistency and I would like to find out why. If anyone has any ideas please share them.Code:if(GetAsyncKeyState(vk_code)<0)
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Did you try
If 1=true then 0=false,Key1=1,if hit,Key1=0,if hitx2,
/idk what i'm talking about.
[IMG]https://i30.photobucke*****m/albums/c335/Joshcarr2006/tumblr_lz1nrntuZf1qdxcglo1_500_zps0388a33f.gif[/IMG]
Ask BA, he's god o__O
probably because GetAsyncKeyState doesn't function properly on modern computers with their fancy multicores and being able to process way too many shizzle at the same time.
Yes but I dont see how getakeysync could be a problem because ... hmmm hold on a sec....
Testing.... yep thats it!
I forgot GetAsyncKeyState returns a signed WORD value. So it actually returns a negative number when it's pressed because the highest bit is set to 1. That is how the whole < 0 thing works. since GetAsyncKeyState is less then zero when pressed, but goddam why go through so much trouble. any nonzero is true... =/Code:#include <iostream.h> #include <windows.h> using namespace std; int main() { while(1) { cout<<GetAsyncKeyState(VK_SPACE); Sleep(200); } return 1; }
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Retoxified (03-26-2010)