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

Method onKeyDown

Engine/source/gui/controls/guiPopUpCtrl.cpp:133–157  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

131
132//------------------------------------------------------------------------------
133bool GuiPopupTextListCtrl::onKeyDown(const GuiEvent &event)
134{
135 //if the control is a dead end, don't process the input:
136 if ( !mVisible || !mActive || !mAwake )
137 return false;
138
139 //see if the key down is a <return> or not
140 if ( event.modifier == 0 )
141 {
142 if ( event.keyCode == KEY_RETURN )
143 {
144 mPopUpCtrl->closePopUp();
145 return true;
146 }
147 else if ( event.keyCode == KEY_ESCAPE )
148 {
149 mSelectedCell.set( -1, -1 );
150 mPopUpCtrl->closePopUp();
151 return true;
152 }
153 }
154
155 //otherwise, pass the event to it's parent
156 return Parent::onKeyDown(event);
157}
158
159void GuiPopupTextListCtrl::onMouseUp(const GuiEvent &event)
160{

Callers

nothing calls this directly

Calls 2

closePopUpMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected