mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 10:36:30 +03:00
Added custom mouse gesture bindings (SpartanJ/ecode#602).
This commit is contained in:
@@ -1302,6 +1302,11 @@ void App::loadKeybindings() {
|
||||
DocSearchController::getDefaultKeybindings(), forceRebind,
|
||||
getMigrateKeybindings(), mConfig.iniState );
|
||||
|
||||
KeybindingsHelper::updateKeybindings( ini, "editor_mouse_bindings", mWindow->getInput(),
|
||||
mMousebindings, mMousebindingsInvert,
|
||||
UICodeEditor::getDefaultMousebindings(), forceRebind,
|
||||
getMigrateKeybindings(), mConfig.iniState );
|
||||
|
||||
auto localKeybindings = getLocalKeybindings();
|
||||
for ( const auto& kb : localKeybindings ) {
|
||||
auto found = mKeybindingsInvert.find( kb.second );
|
||||
@@ -1340,10 +1345,15 @@ void App::reloadKeybindings() {
|
||||
mRealSplitterKeybindings.clear();
|
||||
mRealTerminalKeybindings.clear();
|
||||
mRealDefaultKeybindings.clear();
|
||||
mMousebindings.clear();
|
||||
mMousebindingsInvert.clear();
|
||||
loadKeybindings();
|
||||
mSplitter->forEachEditor( [this]( UICodeEditor* ed ) {
|
||||
ed->getKeyBindings().reset();
|
||||
ed->getKeyBindings().addKeybindsStringUnordered( mKeybindings );
|
||||
ed->getMouseBindings().reset();
|
||||
ed->getMouseBindings().addMousebindsString( mMousebindings );
|
||||
|
||||
} );
|
||||
mSplitter->forEachWidgetType( UI_TYPE_TERMINAL, [this]( UIWidget* widget ) {
|
||||
mTerminalManager->setKeybindings( widget->asType<UITerminal>() );
|
||||
@@ -2547,6 +2557,11 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
|
||||
editor->getKeyBindings().addKeybindsStringUnordered( mKeybindings );
|
||||
}
|
||||
|
||||
if ( !mMousebindings.empty() ) {
|
||||
editor->getMouseBindings().reset();
|
||||
editor->getMouseBindings().addMousebindsString( mMousebindings );
|
||||
}
|
||||
|
||||
editor->on( Event::OnClose, [this, editor]( auto ) {
|
||||
if ( SceneManager::existsSingleton() && !SceneManager::instance()->isShuttingDown() &&
|
||||
editor->hasClass( NOT_UNIQUE_FILENAME ) )
|
||||
|
||||
Reference in New Issue
Block a user