Note 1: When we find a text, press the physical button a AAAAA, you will find that the first time there will be a partition.
Reference:http://tieba.baidu.com/p/1829831956
How does the return value of Getasynckeystate () understand?
The instance code has the IF (:: Getasynckeystate (vk_right) & 0x8000f) This sentence, press the → Key to get 0x1
void Main () { staticint testint=0; while (1) { if( short a =(:: Getasynckeystate (Vk_right)))// { cout< <a<<Endl; cout<<testInt++<<" times "<<Endl; }}}
The above code results found that-32767 appeared once.
if (Short a = (:: Getasynckeystate (Vk_right)) &0x8000f), press output only once 1
Where short negative numbers are stored in the form of a complement to the computer, 32767 is 0x8001-32768 for 0x8000
Summary: 1. When we continue to press the key not to release, use Getasynckeystate (vk_right)) &0x8000f) only return once true; 2. 0X8000F where the starting 8 does not work
Dragon Book DX9 Chapter5 Light Creation and getasynckeystate () &0x8000f issues