summaryrefslogtreecommitdiff
authorerik <erik>2007-02-21 16:59:03 (UTC)
committer erik <erik>2007-02-21 16:59:03 (UTC)
commit6b0fa616c4aac654c549621eb0009ab3eb32fe34 (patch) (unidiff)
treeb5a592194a9cbf3b02b38b0d2e412201beb5b49c
parent45f2e4cdc6e185439ef4bde6e2b8181a4decd032 (diff)
downloadopie-6b0fa616c4aac654c549621eb0009ab3eb32fe34.zip
opie-6b0fa616c4aac654c549621eb0009ab3eb32fe34.tar.gz
opie-6b0fa616c4aac654c549621eb0009ab3eb32fe34.tar.bz2
This commit fixes Opie bug 1839:
http://opie-bugs.oszine.de/view.php?id=1839
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 02b685a..6dc1295 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -308,42 +308,38 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
308 308
309 switch ( keycode ) { 309 switch ( keycode ) {
310 // H38xx/H39xx have no "Q" key anymore - this is now the Mail key 310 // H38xx/H39xx have no "Q" key anymore - this is now the Mail key
311 case HardKey_Menu: { 311 case HardKey_Menu: {
312 if (( d->m_model == Model_iPAQ_H38xx ) || 312 if (( d->m_model == Model_iPAQ_H38xx ) ||
313 ( d->m_model == Model_iPAQ_H39xx ) || 313 ( d->m_model == Model_iPAQ_H39xx ) ||
314 ( d->m_model == Model_iPAQ_H5xxx)) { 314 ( d->m_model == Model_iPAQ_H5xxx)) {
315 newkeycode = HardKey_Mail; 315 newkeycode = HardKey_Mail;
316 } 316 }
317 break; 317 break;
318 } 318 }
319 319
320 // Rotate cursor keys 180 or 270 320 // QT has strange screen coordinate system, so depending
321 // on native device screen orientation, we need to rotate cursor keys
321 case Key_Left : 322 case Key_Left :
322 case Key_Right: 323 case Key_Right:
323 case Key_Up : 324 case Key_Up :
324 case Key_Down : { 325 case Key_Down : {
325 if (( d->m_model == Model_iPAQ_H31xx ) || 326 int quarters;
326 ( d->m_model == Model_iPAQ_H38xx )) { 327 switch (d->m_rotation) {
327 newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; 328 case Rot0: quarters = 3/*270deg*/; break;
329 case Rot90: quarters = 2/*270deg*/; break;
330 case Rot180: quarters = 1/*270deg*/; break;
331 case Rot270: quarters = 0/*270deg*/; break;
328 } 332 }
329 // Rotate the cursor keys by 270 333 newkeycode = Key_Left + ( keycode - Key_Left + quarters ) % 4;
330 // keycode - Key_Left = position of the button starting from left clockwise
331 // add the rotation to it and modolo. No we've the original offset
332 // add the offset to the Key_Left key
333 if (( d->m_model == Model_iPAQ_H5xxx ) ||
334 ( d->m_model == Model_iPAQ_H191x ) ||
335 ( d->m_model == Model_iPAQ_H4xxx ) ||
336 ( d->m_model == Model_iPAQ_H1940 ))
337 newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
338 break; 334 break;
339 } 335 }
340 336
341 // map Power Button short/long press to F34/F35 337 // map Power Button short/long press to F34/F35
342 case HardKey_Suspend: // Hope we don't have infinite recursion here 338 case HardKey_Suspend: // Hope we don't have infinite recursion here
343 case Key_SysReq: { 339 case Key_SysReq: {
344 if ( isPress ) { 340 if ( isPress ) {
345 if ( m_power_timer ) 341 if ( m_power_timer )
346 killTimer ( m_power_timer ); 342 killTimer ( m_power_timer );
347 m_power_timer = startTimer ( 500 ); 343 m_power_timer = startTimer ( 500 );
348 } 344 }
349 else if ( m_power_timer ) { 345 else if ( m_power_timer ) {