author | treke <treke> | 2002-11-17 18:30:27 (UTC) |
---|---|---|
committer | treke <treke> | 2002-11-17 18:30:27 (UTC) |
commit | bdecd392488dee486d302f683b91acf89708d4a6 (patch) (unidiff) | |
tree | 987ed4ddd7c5d0df0ef03f7a949f74837edc9ec7 /noncore/comm/keypebble/krfbcanvas.cpp | |
parent | 44ffc30c0317e47f91ee20b3dc0b719a74d7991c (diff) | |
download | opie-bdecd392488dee486d302f683b91acf89708d4a6.zip opie-bdecd392488dee486d302f683b91acf89708d4a6.tar.gz opie-bdecd392488dee486d302f683b91acf89708d4a6.tar.bz2 |
Resized a couple dialogs to fit better. Now can synthesize right click
events from the corner menu. Still having problems with double click though
Diffstat (limited to 'noncore/comm/keypebble/krfbcanvas.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/krfbcanvas.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp index 918ce8b..049bbd4 100644 --- a/noncore/comm/keypebble/krfbcanvas.cpp +++ b/noncore/comm/keypebble/krfbcanvas.cpp | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <qclipboard.h> | 10 | #include <qclipboard.h> |
11 | #include <qaction.h> | 11 | #include <qaction.h> |
12 | #include <qpixmap.h> | 12 | #include <qpixmap.h> |
13 | #include <qpoint.h> | ||
13 | #include <qapplication.h> | 14 | #include <qapplication.h> |
14 | #include <qmainwindow.h> | 15 | #include <qmainwindow.h> |
15 | #include <qiconset.h> | 16 | #include <qiconset.h> |
@@ -27,6 +28,9 @@ KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) | |||
27 | 28 | ||
28 | viewport()->setFocusPolicy( QWidget::StrongFocus ); | 29 | viewport()->setFocusPolicy( QWidget::StrongFocus ); |
29 | viewport()->setFocus(); | 30 | viewport()->setFocus(); |
31 | |||
32 | nextRightClick=0; | ||
33 | nextDoubleClick=0; | ||
30 | } | 34 | } |
31 | 35 | ||
32 | KRFBCanvas::~KRFBCanvas() | 36 | KRFBCanvas::~KRFBCanvas() |
@@ -124,14 +128,35 @@ void KRFBCanvas::viewportUpdate( int x, int y, int w, int h ) | |||
124 | 128 | ||
125 | void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e ) | 129 | void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e ) |
126 | { | 130 | { |
127 | if ( loggedIn_ ) | 131 | |
132 | if (nextDoubleClick) { | ||
133 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),LeftButton,LeftButton)); | ||
134 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0)); | ||
135 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0)); | ||
136 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); | ||
137 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); | ||
138 | } if (nextRightClick) { | ||
139 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),RightButton,RightButton)); | ||
140 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),RightButton,0)); | ||
141 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); | ||
142 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); | ||
143 | } else if ( loggedIn_ ) | ||
128 | connection_->buffer()->mouseEvent( e ); | 144 | connection_->buffer()->mouseEvent( e ); |
145 | |||
146 | qDebug("Press"); | ||
147 | qDebug(QString::number(e->type()==QEvent::MouseButtonPress)); | ||
129 | } | 148 | } |
130 | 149 | ||
131 | void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) | 150 | void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) |
132 | { | 151 | { |
133 | if ( loggedIn_ ) | 152 | if ( loggedIn_ && !nextRightClick && !nextDoubleClick) { |
134 | connection_->buffer()->mouseEvent( e ); | 153 | connection_->buffer()->mouseEvent( e ); |
154 | } | ||
155 | |||
156 | nextRightClick=0; | ||
157 | nextDoubleClick=0; | ||
158 | qDebug("Release"); | ||
159 | qDebug(QString::number(e->button())); | ||
135 | } | 160 | } |
136 | 161 | ||
137 | void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) | 162 | void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) |
@@ -167,7 +192,6 @@ void KRFBCanvas::clipboardChanged() | |||
167 | void KRFBCanvas::sendCtlAltDel( void) | 192 | void KRFBCanvas::sendCtlAltDel( void) |
168 | { | 193 | { |
169 | 194 | ||
170 | qDebug("Here"); | ||
171 | if ( loggedIn_ ) { | 195 | if ( loggedIn_ ) { |
172 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Control, 0,0)); | 196 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Control, 0,0)); |
173 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Alt, 0,0)); | 197 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Alt, 0,0)); |
@@ -177,3 +201,13 @@ void KRFBCanvas::sendCtlAltDel( void) | |||
177 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyRelease,Qt::Key_Delete, 0,0)); | 201 | connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyRelease,Qt::Key_Delete, 0,0)); |
178 | } | 202 | } |
179 | } | 203 | } |
204 | |||
205 | void KRFBCanvas::markDoubleClick( void) | ||
206 | { | ||
207 | nextRightClick=1; | ||
208 | } | ||
209 | |||
210 | void KRFBCanvas::markRightClick( void) | ||
211 | { | ||
212 | nextRightClick=1; | ||
213 | } | ||