MCPcopy Create free account
hub / github.com/SpartanJ/eepp / onKeyDown

Method onKeyDown

src/eepp/ui/uicodeeditor.cpp:1295–1320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293}
1294
1295Uint32 UICodeEditor::onKeyDown( const KeyEvent& event ) {
1296 if ( getUISceneNode()->getWindow()->getIME().isEditing() )
1297 return 0;
1298
1299 mLastActivity.restart();
1300
1301 if ( NULL == mFont || mUISceneNode->getUIEventDispatcher()->justGainedFocus() )
1302 return 0;
1303
1304 for ( auto& plugin : mPlugins )
1305 if ( plugin->onKeyDown( this, event ) )
1306 return 1;
1307
1308 std::string cmd = mKeyBindings.getCommandFromKeyBind( { event.getKeyCode(), event.getMod() } );
1309 if ( !cmd.empty() ) {
1310 // Allow copy selection on locked mode
1311 if ( !mLocked || mUnlockedCmd.find( cmd ) != mUnlockedCmd.end() ) {
1312 mDoc->execute( cmd, this );
1313 mLastCmdHash = String::hash( cmd );
1314 mLastExecuteEventId = getInput()->getEventsSentId();
1315 return 1;
1316 }
1317 }
1318
1319 return 0;
1320}
1321
1322Uint32 UICodeEditor::onKeyUp( const KeyEvent& event ) {
1323 mLastActivity.restart();

Callers

nothing calls this directly

Calls 11

hashFunction · 0.85
justGainedFocusMethod · 0.80
getUIEventDispatcherMethod · 0.80
getCommandFromKeyBindMethod · 0.80
isEditingMethod · 0.45
getWindowMethod · 0.45
restartMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected