summaryrefslogtreecommitdiff
authorsandman <sandman>2002-06-20 17:36:21 (UTC)
committer sandman <sandman>2002-06-20 17:36:21 (UTC)
commitfd64293dbcfae3bcf3265e31fbe847ac86b2a0af (patch) (unidiff)
tree77b9541ed66bf6cc388da18cc7cdbe463cc2930e
parent0996b7f1bcbdb05db00eadb0cdd60b2066cdd899 (diff)
downloadopie-fd64293dbcfae3bcf3265e31fbe847ac86b2a0af.zip
opie-fd64293dbcfae3bcf3265e31fbe847ac86b2a0af.tar.gz
opie-fd64293dbcfae3bcf3265e31fbe847ac86b2a0af.tar.bz2
virtual key events should use sendKeyEvent, not processKeyEvents
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index cd4f61c..203e23e 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -118,60 +118,60 @@ static const char * paste_xpm[] = {
118ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) 118ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name )
119{ 119{
120 setFixedWidth ( 14 ); 120 setFixedWidth ( 14 );
121 setFixedHeight ( 18 ); 121 setFixedHeight ( 18 );
122 clipboardPixmap = QPixmap ( paste_xpm ); 122 clipboardPixmap = QPixmap ( paste_xpm );
123 menu = 0; 123 menu = 0;
124} 124}
125 125
126ClipboardApplet::~ClipboardApplet ( ) 126ClipboardApplet::~ClipboardApplet ( )
127{ 127{
128} 128}
129 129
130void ClipboardApplet::mousePressEvent ( QMouseEvent *) 130void ClipboardApplet::mousePressEvent ( QMouseEvent *)
131{ 131{
132 if ( !menu ) { 132 if ( !menu ) {
133 menu = new QPopupMenu ( this ); 133 menu = new QPopupMenu ( this );
134 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 0 ); 134 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 0 );
135 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 1 ); 135 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 1 );
136 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 2 ); 136 menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 2 );
137 connect ( menu, SIGNAL( activated ( int )), this, SLOT( action ( int ))); 137 connect ( menu, SIGNAL( activated ( int )), this, SLOT( action ( int )));
138 } 138 }
139 QPoint p = mapToGlobal ( QPoint ( 0, 0 )); 139 QPoint p = mapToGlobal ( QPoint ( 0, 0 ));
140 QSize s = menu-> sizeHint ( ); 140 QSize s = menu-> sizeHint ( );
141 141
142 menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( ))); 142 menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( )));
143} 143}
144 144
145void ClipboardApplet::action(int id) 145void ClipboardApplet::action(int id)
146{ 146{
147 ushort unicode=0; 147 ushort unicode=0;
148 int scan=0; 148 int scan=0;
149 149
150 switch ( id ) { 150 switch ( id ) {
151 case 0: 151 case 0:
152 unicode='X'-'@'; 152 unicode='X'-'@';
153 scan=Key_X; // Cut 153 scan=Key_X; // Cut
154 break; 154 break;
155 case 1: 155 case 1:
156 unicode='C'-'@'; 156 unicode='C'-'@';
157 scan=Key_C; // Copy 157 scan=Key_C; // Copy
158 break; 158 break;
159 case 2: 159 case 2:
160 unicode='V'-'@'; 160 unicode='V'-'@';
161 scan=Key_V; // Paste 161 scan=Key_V; // Paste
162 break; 162 break;
163 } 163 }
164 164
165 if ( scan ) { 165 if ( scan ) {
166 qwsServer->processKeyEvent( unicode, scan, ControlButton, TRUE, FALSE ); 166 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false );
167 qwsServer->processKeyEvent( unicode, scan, ControlButton, FALSE, FALSE ); 167 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false );
168 } 168 }
169} 169}
170 170
171void ClipboardApplet::paintEvent ( QPaintEvent* ) 171void ClipboardApplet::paintEvent ( QPaintEvent* )
172{ 172{
173 QPainter p ( this ); 173 QPainter p ( this );
174 p. drawPixmap ( 0, 1, clipboardPixmap ); 174 p. drawPixmap ( 0, 1, clipboardPixmap );
175} 175}
176 176
177 177