WM_KEYDOWN 이벤트를받을 때 LPARAM의 값을 검사합니다. 그러나 나는 정확하게 다음 16 비트를 검사하고 다음 8 비트 &을 검사하고 있는지 확신 할 수 없다.이 LPARAM이 올바르게 분리되어 있습니까?
http://msdn.microsoft.com/en-us/library/ms646280(v=vs.85).aspx 내 비트 (분할?)인가 올바른? 여기
void outputLParam(LPARAM lParam)
{
printf("Repeat Count : %d\n", (lParam) & ((1L<<16)-1)); // print the value of the 1st 16 bits
printf("Scan Code : %d\n", (lParam >> 0x16) & ((1L<<8)-1)); // print the value of the next 8 bits
printf("Extended Key : %d\n", lParam & 0x24); // print the value of the next bit
printf("Reserved : %d\n", (lParam >> 0x25) & ((1L<<4)-1)); // print the value of the next 4 bits
printf("Context : %d\n", lParam & 0x29); // print the value of the next bit
printf("Prev Key State : %d\n", lParam & 0x30); // print the value of the next bit
printf("Transition Key State: %d\n", lParam & 0x31); // print the value of the next bit
}
이것은 정말로 [이전 질문] (http://stackoverflow.com/questions/6993957/inspecting-the-lparam-on-wm-keydown-incorrect-values)의 후속 조치/계속 사항이었을 것입니다. – Deanna