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 | |||
@@ -12,2 +12,3 @@ | |||
12 | #include <qpixmap.h> | 12 | #include <qpixmap.h> |
13 | #include <qpoint.h> | ||
13 | #include <qapplication.h> | 14 | #include <qapplication.h> |
@@ -29,2 +30,5 @@ KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) | |||
29 | viewport()->setFocus(); | 30 | viewport()->setFocus(); |
31 | |||
32 | nextRightClick=0; | ||
33 | nextDoubleClick=0; | ||
30 | } | 34 | } |
@@ -126,4 +130,19 @@ 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 | } |
@@ -132,4 +151,10 @@ 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 | } |
@@ -169,3 +194,2 @@ void KRFBCanvas::sendCtlAltDel( void) | |||
169 | 194 | ||
170 | qDebug("Here"); | ||
171 | if ( loggedIn_ ) { | 195 | if ( loggedIn_ ) { |
@@ -179 +203,11 @@ void KRFBCanvas::sendCtlAltDel( void) | |||
179 | } | 203 | } |
204 | |||
205 | void KRFBCanvas::markDoubleClick( void) | ||
206 | { | ||
207 | nextRightClick=1; | ||
208 | } | ||
209 | |||
210 | void KRFBCanvas::markRightClick( void) | ||
211 | { | ||
212 | nextRightClick=1; | ||
213 | } | ||