summaryrefslogtreecommitdiff
authorjeremy <jeremy>2002-02-15 15:46:12 (UTC)
committer jeremy <jeremy>2002-02-15 15:46:12 (UTC)
commite6125036c4260fb9aeb40105c1ec58777678792b (patch) (unidiff)
treefe6c6e1bf574560ec83d638ca61fe86fdb75011c
parent7c4ee87ab334a8e245d8345b378400bf787a7d5a (diff)
downloadopie-e6125036c4260fb9aeb40105c1ec58777678792b.zip
opie-e6125036c4260fb9aeb40105c1ec58777678792b.tar.gz
opie-e6125036c4260fb9aeb40105c1ec58777678792b.tar.bz2
Adding support for the ipaq's rec button. Not totally functioning yet, but
getting there.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 9c0025d..8875cdf 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -141,6 +141,10 @@ VMemo::VMemo( QWidget *parent, const char *name )
141 141
142 recording = FALSE; 142 recording = FALSE;
143 143
144 myChannel = new QCopChannel( "QPE/VMemo", this );
145 connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)),
146 this, SLOT(receive(const QCString&, const QByteArray&)) );
147
144 struct utsname name; /* check for embedix kernel running on the zaurus, if 148 struct utsname name; /* check for embedix kernel running on the zaurus, if
145 lineo change string, this break 149 lineo change string, this break
146 */ 150 */
@@ -151,15 +155,70 @@ VMemo::VMemo( QWidget *parent, const char *name )
151 if(release.find("embedix",0,TRUE) !=-1) 155 if(release.find("embedix",0,TRUE) !=-1)
152 systemZaurus=TRUE; 156 systemZaurus=TRUE;
153 else 157 else
158 {
159 int fr;
154 systemZaurus=FALSE; 160 systemZaurus=FALSE;
161
162 if ((fr = fork()) == -1)
163 {
164 qWarning("Fork failed");
155 } 165 }
166 else if (fr == 0)
167 {
168 int key, max;
169 fd_set fdr;
170 char buffer[10];
156 171
172 key = open("/dev/touchscreen/key", O_RDONLY);
173 if (key == -1)
174 {
175 qWarning("Could not open key");
176 exit(1);
177 }
178
179 while(1)
180 {
181 FD_ZERO(&fdr);
182 FD_SET(key, &fdr);
183 max = key;
184
185 qWarning("while");
186
187 read(key, buffer, 10);
188 if(*buffer == (char)129)
189 {
190 qWarning("REC = stop");
191 QCopEnvelope( "QPE/VMemo", "toggleRecord()");
192 activate_signal("toggleRecordNow()");
193 }
194 else if(*buffer == (char)1)
195 {
196 qWarning("REC = start");
197 QCopEnvelope( "QPE/VMemo", "toggleRecord()");
198 activate_signal("toggleRecordNow()");
199 }
200 }
201 }
202 else if(fr)
203 qWarning("parent: Fork = good");
204 }
205 }
206 qWarning("VMemo done init");
157} 207}
158 208
159VMemo::~VMemo() 209VMemo::~VMemo()
160{ 210{
161} 211}
162 212
213void VMemo::receive( const QCString &msg, const QByteArray &data )
214{
215 QDataStream stream( data, IO_ReadOnly );
216 qWarning(msg);
217 if ( msg == "toggleRecord()" ) {
218 qWarning("Hello");
219 }
220}
221
163void VMemo::paintEvent( QPaintEvent* ) 222void VMemo::paintEvent( QPaintEvent* )
164{ 223{
165 QPainter p(this); 224 QPainter p(this);