MCPcopy Create free account
hub / github.com/axmolengine/axmol / onButtonEvent

Method onButtonEvent

core/base/Controller-android.cpp:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 }
87
88 static void onButtonEvent(std::string_view deviceName,
89 int deviceId,
90 int keyCode,
91 bool isPressed,
92 float value,
93 bool isAnalog)
94 {
95 auto iter = findController(deviceName, deviceId);
96 if (iter == Controller::s_allController.end())
97 {
98 AXLOGD("onButtonEvent:connect new controller.");
99 onConnected(deviceName, deviceId);
100 iter = findController(deviceName, deviceId);
101 }
102
103 (*iter)->onButtonEvent(keyCode, isPressed, value, isAnalog);
104 }
105
106 static void onAxisEvent(std::string_view deviceName, int deviceId, int axisCode, float value, bool isAnalog)
107 {

Callers

nothing calls this directly

Calls 4

findControllerFunction · 0.85
onConnectedFunction · 0.85
onButtonEventMethod · 0.65
endMethod · 0.45

Tested by

no test coverage detected