MCPcopy Create free account
hub / github.com/defold/defold / AcquireInputFocus

Function AcquireInputFocus

engine/gameobject/src/gameobject/gameobject.cpp:3080–3106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3078 }
3079
3080 void AcquireInputFocus(Collection* collection, HInstance instance)
3081 {
3082 bool found = false;
3083 for (uint32_t i = 0; i < collection->m_InputFocusStack.Size(); ++i)
3084 {
3085 if (collection->m_InputFocusStack[i] == instance)
3086 {
3087 found = true;
3088 }
3089 if (found && i < collection->m_InputFocusStack.Size() - 1)
3090 {
3091 collection->m_InputFocusStack[i] = collection->m_InputFocusStack[i + 1];
3092 }
3093 }
3094 if (found)
3095 {
3096 collection->m_InputFocusStack.Pop();
3097 }
3098 if (!collection->m_InputFocusStack.Full())
3099 {
3100 collection->m_InputFocusStack.Push(instance);
3101 }
3102 else
3103 {
3104 dmLogWarning("Input focus could not be acquired since the buffer is full (%d).", collection->m_InputFocusStack.Size());
3105 }
3106 }
3107
3108 void ReleaseInputFocus(Collection* collection, HInstance instance)
3109 {

Callers 5

DispatchMessagesFunctionFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_PFunction · 0.85
TEST_FFunction · 0.85

Calls 4

SizeMethod · 0.45
PopMethod · 0.45
FullMethod · 0.45
PushMethod · 0.45

Tested by 4

TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_PFunction · 0.68
TEST_FFunction · 0.68