Register a RAWINPUTDEVICE representing the mouse to receive raw mouse deltas using WM_INPUT
| 127 | // Register a RAWINPUTDEVICE representing the mouse to receive raw |
| 128 | // mouse deltas using WM_INPUT |
| 129 | void initRawMouse() |
| 130 | { |
| 131 | const RAWINPUTDEVICE rawMouse{0x01, 0x02, 0, nullptr}; // HID usage: mouse device class, no flags, follow keyboard focus |
| 132 | |
| 133 | if (RegisterRawInputDevices(&rawMouse, 1, sizeof(rawMouse)) != TRUE) |
| 134 | sf::err() << "Failed to initialize raw mouse input" << std::endl; |
| 135 | } |
| 136 | } // namespace |
| 137 | |
| 138 | namespace sf::priv |