| 4297 | } |
| 4298 | |
| 4299 | static void onButtonEvent(int deviceId, int keyCode, bool isPressed, float value, bool isAnalog) |
| 4300 | { |
| 4301 | auto iter = findController(deviceId); |
| 4302 | if (iter == Controller::s_allController.end()) |
| 4303 | { |
| 4304 | AXLOGD("ControllerImpl::onButtonEvent: new controller detected. Registering..."); |
| 4305 | onConnected(glfwGetJoystickName(deviceId), deviceId); |
| 4306 | iter = findController(deviceId); |
| 4307 | } |
| 4308 | |
| 4309 | (*iter)->onButtonEvent(keyCode, isPressed, value, isAnalog); |
| 4310 | } |
| 4311 | |
| 4312 | static void onAxisEvent(int deviceId, int axisCode, float value, bool isAnalog) |
| 4313 | { |
no test coverage detected