mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-04-20 01:31:01 +01:00
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:
parent
93e40ade4a
commit
85c7d8ea97
@ -149,9 +149,11 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
|
if (pressedButtons & Qt.LeftButton){
|
||||||
var coord = correctDistortion(mouse.x, mouse.y);
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
kterminal.mouseMove(coord.width, coord.height);
|
kterminal.mouseMove(coord.width, coord.height);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onPressed: {
|
onPressed: {
|
||||||
if (mouse.button == Qt.LeftButton){
|
if (mouse.button == Qt.LeftButton){
|
||||||
var coord = correctDistortion(mouse.x, mouse.y);
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!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>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
@ -199,8 +199,12 @@ void Session::addView(KTerminalDisplay * widget)
|
|||||||
|
|
||||||
// allow emulation to notify view when the foreground process
|
// allow emulation to notify view when the foreground process
|
||||||
// indicates whether or not it is interested in mouse signals
|
// 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() );
|
//widget->setUsesMouse( _emulation->programUsesMouse() );
|
||||||
|
|
||||||
|
@ -185,8 +185,6 @@ KTerminalDisplay::KTerminalDisplay(QQuickItem *parent) :
|
|||||||
_topMargin = DEFAULT_TOP_MARGIN;
|
_topMargin = DEFAULT_TOP_MARGIN;
|
||||||
_leftMargin = DEFAULT_LEFT_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
|
// setup timers for blinking cursor and text
|
||||||
_blinkTimer = new QTimer(this);
|
_blinkTimer = new QTimer(this);
|
||||||
connect(_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkEvent()));
|
connect(_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkEvent()));
|
||||||
@ -216,10 +214,6 @@ KTerminalDisplay::~KTerminalDisplay()
|
|||||||
delete[] _image;
|
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)
|
void KTerminalDisplay::setSession(KSession * session)
|
||||||
{
|
{
|
||||||
if (m_session != session) {
|
if (m_session != session) {
|
||||||
@ -480,9 +474,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
|
|||||||
if (m_focusOnClick) forcedFocus();
|
if (m_focusOnClick) forcedFocus();
|
||||||
if (m_showVKBonClick) ShowVKB(true);
|
if (m_showVKBonClick) ShowVKB(true);
|
||||||
|
|
||||||
QPoint pos(x,y);
|
|
||||||
qDebug() << "Mousepress " <<pos;
|
|
||||||
|
|
||||||
int charLine;
|
int charLine;
|
||||||
int charColumn;
|
int charColumn;
|
||||||
getCharacterPosition(QPoint(x,y), charLine, charColumn);
|
getCharacterPosition(QPoint(x,y), charLine, charColumn);
|
||||||
@ -492,7 +483,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
|
|||||||
|
|
||||||
if(_mouseMarks){
|
if(_mouseMarks){
|
||||||
emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
|
emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
QPoint pos = QPoint(charColumn, charLine);
|
QPoint pos = QPoint(charColumn, charLine);
|
||||||
|
|
||||||
@ -505,8 +495,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){
|
|||||||
void KTerminalDisplay::mouseMove(qreal x, qreal y){
|
void KTerminalDisplay::mouseMove(qreal x, qreal y){
|
||||||
QPoint pos(x, y);
|
QPoint pos(x, y);
|
||||||
|
|
||||||
qDebug() << "Mouse move" << pos;
|
|
||||||
|
|
||||||
if(_mouseMarks){
|
if(_mouseMarks){
|
||||||
int charLine;
|
int charLine;
|
||||||
int charColumn;
|
int charColumn;
|
||||||
@ -526,7 +514,7 @@ void KTerminalDisplay::mouseDoubleClick(qreal x, qreal y){
|
|||||||
int charColumn;
|
int charColumn;
|
||||||
getCharacterPosition(pos, charLine, 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);
|
//emit mouseSignal(0, charColumn + 1, charLine + 1, 0);
|
||||||
} else {
|
} else {
|
||||||
_wordSelectionMode = true;
|
_wordSelectionMode = true;
|
||||||
@ -537,16 +525,12 @@ void KTerminalDisplay::mouseDoubleClick(qreal x, qreal y){
|
|||||||
void KTerminalDisplay::mouseRelease(qreal x, qreal y){
|
void KTerminalDisplay::mouseRelease(qreal x, qreal y){
|
||||||
_actSel = 0;
|
_actSel = 0;
|
||||||
|
|
||||||
QPoint pos(x,y);
|
|
||||||
|
|
||||||
qDebug() << "Mousepress " << pos;
|
|
||||||
|
|
||||||
if(_mouseMarks){
|
if(_mouseMarks){
|
||||||
int charLine;
|
int charLine;
|
||||||
int charColumn;
|
int charColumn;
|
||||||
getCharacterPosition(QPoint(x,y), charLine, charColumn);
|
getCharacterPosition(QPoint(x,y), charLine, charColumn);
|
||||||
|
|
||||||
//emit mouseSignal(0, charColumn + 1, charLine + 1, 2);
|
emit mouseSignal(0, charColumn + 1, charLine + 1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user