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

Method onGLFWCharCallback

core/platform/RenderViewImpl.cpp:1276–1297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276void RenderViewImpl::onGLFWCharCallback(GLFWwindow* /*window*/, unsigned int charCode)
1277{
1278 std::string utf8String;
1279 StringUtils::UTF32ToUTF8(std::u32string_view{(char32_t*)&charCode, (size_t)1}, utf8String);
1280 static std::unordered_set<std::string_view> controlUnicode = {
1281 "\xEF\x9C\x80", // up
1282 "\xEF\x9C\x81", // down
1283 "\xEF\x9C\x82", // left
1284 "\xEF\x9C\x83", // right
1285 "\xEF\x9C\xA8", // delete
1286 "\xEF\x9C\xA9", // home
1287 "\xEF\x9C\xAB", // end
1288 "\xEF\x9C\xAC", // pageup
1289 "\xEF\x9C\xAD", // pagedown
1290 "\xEF\x9C\xB9" // clear
1291 };
1292 // Check for send control key
1293 if (controlUnicode.find(utf8String) == controlUnicode.end())
1294 {
1295 IMEDispatcher::sharedDispatcher()->dispatchInsertText(utf8String.c_str(), utf8String.size());
1296 }
1297}
1298
1299void RenderViewImpl::onGLFWWindowPosCallback(GLFWwindow* /*window*/, int x, int y)
1300{

Callers 1

onGLFWCharCallbackMethod · 0.45

Calls 6

UTF32ToUTF8Function · 0.85
dispatchInsertTextMethod · 0.80
findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected