Pass wheel events to the app in mouse mode.

svn path=/trunk/kdebase/konsole/; revision=172583
wilder-portage
Malte Starostik 24 years ago
parent 27decf6369
commit 1aed851ed8
  1. 12
      konsole/TEWidget.cpp
  2. 1
      konsole/TEWidget.h
  3. 3
      konsole/TEmuVt102.cpp

@ -1145,6 +1145,18 @@ void TEWidget::mouseDoubleClickEvent(QMouseEvent* ev)
QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(tripleClickTimeout()));
}
void TEWidget::wheelEvent( QWheelEvent* ev )
{
if (!mouse_marks)
{
QPoint tL = contentsRect().topLeft();
int tLx = tL.x();
int tLy = tL.y();
QPoint pos = QPoint((ev->x()-tLx-bX)/font_w,(ev->y()-tLy-bY)/font_h);
emit mouseSignal( ev->delta() > 0 ? 4 : 5, pos.x() + 1, pos.y() + 1 );
}
}
void TEWidget::tripleClickTimeout()
{
possibleTripleClick=false;

@ -143,6 +143,7 @@ protected:
void mousePressEvent( QMouseEvent* );
void mouseReleaseEvent( QMouseEvent* );
void mouseMoveEvent( QMouseEvent* );
void wheelEvent( QWheelEvent* );
void focusInEvent( QFocusEvent * );
void focusOutEvent( QFocusEvent * );

@ -786,6 +786,9 @@ void TEmuVt102::reportAnswerBack()
void TEmuVt102::onMouse( int cb, int cx, int cy )
{ char tmp[20];
if (!connected) return;
// normal buttons are passed as 0x20 + button,
// mouse wheel (buttons 4,5) as 0x60 + button
if (cb >= 4) cb += 0x40;
sprintf(tmp,"\033[M%c%c%c",cb+040,cx+040,cy+040);
sendString(tmp);
}

Loading…
Cancel
Save