更新时间:2023-11-21 11:52:28
问题尚不清楚,但是我可以通过键号"猜测您的意思是原始键标识符(该标识符先于键被识别为状态键,字符键等),称为"扫描代码".您可以将其作为CWnd::OnKeyDown
的参数nFlags
的低字节来获取;请参阅:
http://msdn.microsoft.com/en-us/library/983st27a%28v = vs.100%29.aspx [ ^ ].
另请参见: http://en.wikipedia.org/wiki/Scan_code [
The question is not clear, but I can guess by "key number" you mean a raw key identifier (which comes into play before a key is recognized as a status key, character key, etc.), which is called "scan code". You can get it as lower byte of the parameternFlags
ofCWnd::OnKeyDown
; please see:
http://msdn.microsoft.com/en-us/library/983st27a%28v=vs.100%29.aspx[^].
See also: http://en.wikipedia.org/wiki/Scan_code[^].
You can extract scan code fromnFlags
like this:
byte scanCode = nFlags & 0xFF;