This is an automated email from the git hooks/post-receive script. odyx pushed a commit to branch upstream/latest in repository colobot.
commit 80c9b35ce281372770a821bba8c79053b431c953 Author: krzys-h <krzy...@interia.pl> Date: Tue Nov 11 17:40:48 2014 +0100 Close CBot editor by CTRL+Action key (default ENTER), closes #383 --- src/ui/edit.cpp | 10 +++++----- src/ui/studio.cpp | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index b6e6bbf..1e55705 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -437,26 +437,26 @@ bool CEdit::EventProcess(const Event &event) return true; } - if ( event.key.key == KEY(BACKSPACE) ) // backspace ( <- ) ? + if ( event.key.key == KEY(BACKSPACE) && !bControl ) // backspace ( <- ) ? { Delete(-1); SendModifEvent(); return true; } - if ( event.key.key == KEY(DELETE) ) + if ( event.key.key == KEY(DELETE) && !bControl ) { Delete(1); SendModifEvent(); return true; } - if ( event.key.key == KEY(RETURN) ) + if ( event.key.key == KEY(RETURN) && !bControl ) { Insert('\n'); SendModifEvent(); return true; } - if ( event.key.key == KEY(TAB) ) + if ( event.key.key == KEY(TAB) && !bControl ) { Insert('\t'); SendModifEvent(); @@ -464,7 +464,7 @@ bool CEdit::EventProcess(const Event &event) } } - if ( event.type == EVENT_KEY_DOWN && m_bFocus ) + if ( event.type == EVENT_KEY_DOWN && !bControl && m_bFocus ) { if (event.key.unicode >= ' ') { diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index 5f4ca34..5482525 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -125,6 +125,18 @@ bool CStudio::EventProcess(const Event &event) newEvent.type = EVENT_STUDIO_OK; m_event->AddEvent(newEvent); } + + if ( event.type == EVENT_KEY_DOWN ) + { + if ( (event.key.key == m_main->GetInputBinding(INPUT_SLOT_ACTION).primary || + event.key.key == m_main->GetInputBinding(INPUT_SLOT_ACTION).secondary) && + (event.kmodState & KEY_MOD(CTRL)) != 0 ) + { + Event newEvent = event; + newEvent.type = EVENT_STUDIO_OK; + m_event->AddEvent(newEvent); + } + } if ( event.type == EVENT_STUDIO_EDIT ) // text modifief? { -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git _______________________________________________ Pkg-games-commits mailing list Pkg-games-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits