MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / OnKeyDown

Method OnKeyDown

ReClass/CClassView.cpp:202–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void CClassView::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
203{
204 std::vector<HOTSPOT>::iterator FirstSelected;
205 std::vector<HOTSPOT>::iterator Found;
206 CNodePtr* PtrNode;
207 CNodeClass* ClassNode;
208 CNodeBase* FindNode;
209 ULONG_PTR FindAddress;
210
211 if (nChar == VK_DOWN)
212 {
213 FirstSelected = m_Selected.begin( );
214 if (FirstSelected != m_Selected.end( ))
215 {
216 if (FirstSelected->Object->GetType( ) == nt_pointer)
217 {
218 PtrNode = static_cast<CNodePtr*>(FirstSelected->Object);
219 FindNode = static_cast<CNodeBase*>(PtrNode->GetClass( ));
220
221 Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ),
222 [FindNode]( const HOTSPOT hs ) { return (hs.Object == FindNode); } );
223 if (Found != m_Hotspots.end( ))
224 {
225 // Select the found hotspot
226 ClearSelection( );
227 Found->Object->Select( );
228 m_Selected.push_back( *Found );
229 }
230 }
231 else if (FirstSelected->Object->GetType( ) == nt_class)
232 {
233 ClassNode = static_cast<CNodeClass*>(FirstSelected->Object);
234 FindNode = static_cast<CNodeBase*>(ClassNode->GetNode( 0 ));
235
236 Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ),
237 [FindNode]( const HOTSPOT hs ) { return (hs.Object == FindNode); } );
238 if (Found != m_Hotspots.end( ))
239 {
240 ClearSelection( );
241 Found->Object->Select( );
242 m_Selected.push_back( *Found );
243 }
244 }
245 else
246 {
247 if (m_Hotspots[0].Object != FirstSelected->Object)
248 {
249 FindAddress = FirstSelected->Address + FirstSelected->Object->GetMemorySize( );
250
251 Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ),
252 [FindAddress] ( const HOTSPOT hs ) { return (hs.Address == FindAddress); } );
253 if (Found != m_Hotspots.end( ))
254 {
255 if (Found->Address == m_Hotspots.back( ).Address)
256 {
257 if (m_Scroll.IsWindowEnabled( ))
258 m_Scroll.SetScrollPos( m_Scroll.GetScrollPos( ) + 1 );
259 }

Callers

nothing calls this directly

Calls 10

GetTypeMethod · 0.80
GetNodeMethod · 0.80
GetParentMethod · 0.80
CalcAllOffsetsMethod · 0.80
clearMethod · 0.80
GetClassMethod · 0.45
SelectMethod · 0.45
GetMemorySizeMethod · 0.45
sizeMethod · 0.45
DeleteNodeMethod · 0.45

Tested by

no test coverage detected