MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onKeyDown

Method onKeyDown

Engine/source/gui/controls/guiPopUpCtrlEx.cpp:168–192  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

166
167//------------------------------------------------------------------------------
168bool GuiPopupTextListCtrlEx::onKeyDown(const GuiEvent &event)
169{
170 //if the control is a dead end, don't process the input:
171 if ( !mVisible || !mActive || !mAwake )
172 return false;
173
174 //see if the key down is a <return> or not
175 if ( event.modifier == 0 )
176 {
177 if ( event.keyCode == KEY_RETURN )
178 {
179 mPopUpCtrl->closePopUp();
180 return true;
181 }
182 else if ( event.keyCode == KEY_ESCAPE )
183 {
184 mSelectedCell.set( -1, -1 );
185 mPopUpCtrl->closePopUp();
186 return true;
187 }
188 }
189
190 //otherwise, pass the event to it's parent
191 return Parent::onKeyDown(event);
192}
193
194void GuiPopupTextListCtrlEx::onMouseUp(const GuiEvent &event)
195{

Callers

nothing calls this directly

Calls 2

closePopUpMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected