RAWINPUT.Keyboard: NUMLOCK=ON 时如何检测方向键?
RAWINPUT.Keyboard: How to detect arrow keys when NUMLOCK=ON?
当NUMLOCK=ON时
按键ARROW_UP按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_DOWN按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_LEFT按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_RIGHT按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
NUMLOCK=ON时如何检测方向键?
- 当NUMLOCK=OFF时一切正常;
- DirectInput(来自 DirectX 8.0)在这两种情况下都运行良好;
添加标志:RIDEV_NOLEGACY 并过滤 VKey == 255
的消息
当NUMLOCK=ON时
按键ARROW_UP按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_DOWN按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_LEFT按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
按键ARROW_RIGHT按下:
data.keyboard.MakeCode = 42;
data.keyboard.VKey = 255;
data.keyboard.Flags = 2;
data.keyboard.Message = 256 (WM_KEYDOWN)
NUMLOCK=ON时如何检测方向键?
- 当NUMLOCK=OFF时一切正常;
- DirectInput(来自 DirectX 8.0)在这两种情况下都运行良好;
添加标志:RIDEV_NOLEGACY 并过滤 VKey == 255
的消息