author | sandman <sandman> | 2002-11-21 22:34:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-21 22:34:23 (UTC) |
commit | 7f5fc5e8e1cadbeae4a6f13b1efcbe3468505795 (patch) (unidiff) | |
tree | c71c2b5a40b5b110bbb42b434e8ca743dbb69c69 /libopie/odevice.cpp | |
parent | 71f340d760a5863152ff5d22c60334f421a6c488 (diff) | |
download | opie-7f5fc5e8e1cadbeae4a6f13b1efcbe3468505795.zip opie-7f5fc5e8e1cadbeae4a6f13b1efcbe3468505795.tar.gz opie-7f5fc5e8e1cadbeae4a6f13b1efcbe3468505795.tar.bz2 |
support for the new H3900 iPAQ in the iPAQ keyfilter. Since HP thinks it is
funny to change the screen rotation on every model, I have also
restructured the keyfilter to make it more readable.
-rw-r--r-- | libopie/odevice.cpp | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index d8415ad..bc43c52 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -514,48 +514,46 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b | |||
514 | { | 514 | { |
515 | int newkeycode = keycode; | 515 | int newkeycode = keycode; |
516 | 516 | ||
517 | 517 | switch ( keycode ) { | |
518 | // simple susbstitutions | 518 | // H38xx/H39xx have no "Q" key anymore - this is now the Mail key |
519 | switch ( d-> m_model ) { | 519 | case HardKey_Menu: { |
520 | case Model_iPAQ_H38xx: | 520 | if (( d-> m_model == Model_iPAQ_H38xx ) || |
521 | // H38xx has no "Q" key anymore - this is now the Mail key | 521 | ( d-> m_model == Model_iPAQ_H39xx )) { |
522 | if ( keycode == HardKey_Menu ) | ||
523 | newkeycode = HardKey_Mail; | 522 | newkeycode = HardKey_Mail; |
524 | //nobreak | ||
525 | |||
526 | case Model_iPAQ_H31xx: | ||
527 | // Rotate cursor keys 180° | ||
528 | switch ( keycode ) { | ||
529 | case Key_Left : newkeycode = Key_Right; break; | ||
530 | case Key_Right: newkeycode = Key_Left; break; | ||
531 | case Key_Up : newkeycode = Key_Down; break; | ||
532 | case Key_Down : newkeycode = Key_Up; break; | ||
533 | } | 523 | } |
534 | //nobreak; | 524 | break; |
535 | 525 | } | |
536 | case Model_iPAQ_H36xx: | 526 | |
537 | case Model_iPAQ_H37xx: | 527 | // Rotate cursor keys 180° |
538 | // map Power Button short/long press to F34/F35 | 528 | case Key_Left : |
539 | if ( keycode == Key_SysReq ) { | 529 | case Key_Right: |
540 | if ( isPress ) { | 530 | case Key_Up : |
541 | if ( m_power_timer ) | 531 | case Key_Down : { |
542 | killTimer ( m_power_timer ); | 532 | if (( d-> m_model == Model_iPAQ_H31xx ) || |
543 | m_power_timer = startTimer ( 500 ); | 533 | ( d-> m_model == Model_iPAQ_H38xx )) { |
544 | } | 534 | newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; |
545 | else if ( m_power_timer ) { | ||
546 | killTimer ( m_power_timer ); | ||
547 | m_power_timer = 0; | ||
548 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); | ||
549 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); | ||
550 | } | ||
551 | newkeycode = Key_unknown; | ||
552 | } | 535 | } |
553 | //nobreak; | ||
554 | |||
555 | default: | ||
556 | break; | 536 | break; |
557 | } | 537 | } |
558 | 538 | ||
539 | // map Power Button short/long press to F34/F35 | ||
540 | case Key_SysReq: { | ||
541 | if ( isPress ) { | ||
542 | if ( m_power_timer ) | ||
543 | killTimer ( m_power_timer ); | ||
544 | m_power_timer = startTimer ( 500 ); | ||
545 | } | ||
546 | else if ( m_power_timer ) { | ||
547 | killTimer ( m_power_timer ); | ||
548 | m_power_timer = 0; | ||
549 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); | ||
550 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); | ||
551 | } | ||
552 | newkeycode = Key_unknown; | ||
553 | break; | ||
554 | } | ||
555 | } | ||
556 | |||
559 | if ( newkeycode != keycode ) { | 557 | if ( newkeycode != keycode ) { |
560 | if ( newkeycode != Key_unknown ) | 558 | if ( newkeycode != Key_unknown ) |
561 | QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); | 559 | QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); |