Removed mouse use since is not working, removed some prints and avoid passing mousemove events if the left button is not pressed.

This commit is contained in:
Filippo Scognamiglio 2014-07-07 00:38:08 +02:00
parent 93e40ade4a
commit 85c7d8ea97
5 changed files with 14 additions and 24 deletions

View File

@ -149,8 +149,10 @@ Item{
}
}
onPositionChanged: {
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseMove(coord.width, coord.height);
if (pressedButtons & Qt.LeftButton){
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseMove(coord.width, coord.height);
}
}
onPressed: {
if (mouse.button == Qt.LeftButton){

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-07-02T00:31:14. -->
<!-- Written by QtCreator 3.0.1, 2014-07-07T00:26:31. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>

View File

@ -64,7 +64,7 @@ Emulation::Emulation() :
QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) );
// listen for mouse status changes
connect( this , SIGNAL(programUsesMouseChanged(bool)) ,
connect( this , SIGNAL(programUsesMouseChanged(bool)) ,
SLOT(usesMouseChanged(bool)) );
}

View File

@ -199,8 +199,12 @@ void Session::addView(KTerminalDisplay * widget)
// allow emulation to notify view when the foreground process
// indicates whether or not it is interested in mouse signals
connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget ,
SLOT(setUsesMouse(bool)) );
// TODO Disabled since at the moment it is not working properly.
// Remember to reenable that once it' is's working.
//connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget ,
// SLOT(setUsesMouse(bool)) );
//widget->setUsesMouse( _emulation->programUsesMouse() );

View File

@ -185,8 +185,6 @@ KTerminalDisplay::KTerminalDisplay(QQuickItem *parent) :
_topMargin = DEFAULT_TOP_MARGIN;
_leftMargin = DEFAULT_LEFT_MARGIN;
connect(this, SIGNAL(mouseSignal(int,int,int,int)), this, SLOT(banana(int,int,int,int)));
// setup timers for blinking cursor and text
_blinkTimer = new QTimer(this);
connect(_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkEvent()));
@ -216,10 +214,6 @@ KTerminalDisplay::~KTerminalDisplay()
delete[] _image;
}
void KTerminalDisplay::banana(int x, int y, int z, int w){
qDebug() << "Called banana " << x << " " << y << " " << z << " " << w;
}
void KTerminalDisplay::setSession(KSession * session)
{
if (m_session != session) {
@ -480,9 +474,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
if (m_focusOnClick) forcedFocus();
if (m_showVKBonClick) ShowVKB(true);
QPoint pos(x,y);
qDebug() << "Mousepress " <<pos;
int charLine;
int charColumn;
getCharacterPosition(QPoint(x,y), charLine, charColumn);
@ -492,7 +483,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
if(_mouseMarks){
emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
return;
} else {
QPoint pos = QPoint(charColumn, charLine);
@ -505,8 +495,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
void KTerminalDisplay::mouseMove(qreal x, qreal y){
QPoint pos(x, y);
qDebug() << "Mouse move" << pos;
if(_mouseMarks){
int charLine;
int charColumn;
@ -526,7 +514,7 @@ void KTerminalDisplay::mouseDoubleClick(qreal x, qreal y){
int charColumn;
getCharacterPosition(pos, charLine, charColumn);
//emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
//emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
} else {
_wordSelectionMode = true;
@ -537,16 +525,12 @@ void KTerminalDisplay::mouseDoubleClick(qreal x, qreal y){
void KTerminalDisplay::mouseRelease(qreal x, qreal y){
_actSel = 0;
QPoint pos(x,y);
qDebug() << "Mousepress " << pos;
if(_mouseMarks){
int charLine;
int charColumn;
getCharacterPosition(QPoint(x,y), charLine, charColumn);
//emit mouseSignal(0, charColumn + 1, charLine + 1, 2);
emit mouseSignal(0, charColumn + 1, charLine + 1, 2);
}
}