Version: 0.8.0 RC1 (using KDE KDE 3.2.0) Installed from: Gentoo Packages Compiler: gcc (GCC) 3.3.2 20031218 OS: Linux I selected to do the single-shot chat style however i went in to the shortcuts for a single-shot window and bound enter. however its bound and when i hit enter it does not send even though it IS bound. ctrl-enter does work though so i don't understand.
This is confirmed in kopete 0.80.
Mine!
CVS commit by lilachaze: Make enter and return work as keyboard shortcuts in the single-shot message window. This is a hack, but I couldn't find a better way to divert the keypresses from the text input widget, so I stole this idea from the chat window. CCMAIL: 73661-done@bugs.kde.org M +34 -0 kopeteemailwindow.cpp 1.35 M +1 -0 kopeteemailwindow.h 1.7 --- kdenetwork/kopete/kopete/chatwindow/kopeteemailwindow.cpp #1.34:1.35 @@ -30,4 +30,5 @@ #include <kcolordialog.h> #include <kconfig.h> +#include <kcursor.h> #include <kdebug.h> #include <kdeversion.h> @@ -214,4 +215,6 @@ KopeteEmailWindow::KopeteEmailWindow( Ko m_type = KopeteMessage::Email; + d->txtEntry->installEventFilter( this ); + KCursor::setAutoHideCursor( d->txtEntry, true, true ); } @@ -296,4 +299,35 @@ void KopeteEmailWindow::initActions(void } +bool KopeteEmailWindow::eventFilter( QObject *o, QEvent *e ) +{ + if ( o->inherits( "KTextEdit" ) ) + KCursor::autoHideEventFilter( o, e ); + + if( e->type() == QEvent::KeyPress ) + { + QKeyEvent *event = static_cast<QKeyEvent*>( e ); + KKey key( event ); + + // NOTE: + // shortcut.contains( key ) doesn't work. It was the old way we used to do it, but it is incorrect + // because if you have a multi-key shortcut then pressing any of the keys in + // that shortcut individually causes the shortcut to be activated. + + if( d->chatSend->isEnabled() ) + { + for( uint i = 0; i < d->chatSend->shortcut().count(); i++ ) + { + if( key == d->chatSend->shortcut().seq(i).key(0) ) + { + sendMessage(); + return true; + } + } + } + } + + return false; +} + void KopeteEmailWindow::slotViewToolBar() { --- kdenetwork/kopete/kopete/chatwindow/kopeteemailwindow.h #1.6:1.7 @@ -79,4 +79,5 @@ protected: virtual bool queryExit(); virtual void windowActivationChange( bool activated ); + virtual bool KopeteEmailWindow::eventFilter( QObject *o, QEvent *e ); private slots: