summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index a3c30cb..0e620ba 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -705,97 +705,97 @@ bool iPAQ::setLedState ( OLed l, OLedState st )
705 return false; 705 return false;
706} 706}
707 707
708 708
709bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) 709bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat )
710{ 710{
711 int newkeycode = keycode; 711 int newkeycode = keycode;
712 712
713 switch ( keycode ) { 713 switch ( keycode ) {
714 // H38xx/H39xx have no "Q" key anymore - this is now the Mail key 714 // H38xx/H39xx have no "Q" key anymore - this is now the Mail key
715 case HardKey_Menu: { 715 case HardKey_Menu: {
716 if (( d-> m_model == Model_iPAQ_H38xx ) || 716 if (( d-> m_model == Model_iPAQ_H38xx ) ||
717 ( d-> m_model == Model_iPAQ_H39xx )) { 717 ( d-> m_model == Model_iPAQ_H39xx )) {
718 newkeycode = HardKey_Mail; 718 newkeycode = HardKey_Mail;
719 } 719 }
720 break; 720 break;
721 } 721 }
722 722
723 // Rotate cursor keys 180° 723 // Rotate cursor keys 180°
724 case Key_Left : 724 case Key_Left :
725 case Key_Right: 725 case Key_Right:
726 case Key_Up : 726 case Key_Up :
727 case Key_Down : { 727 case Key_Down : {
728 if (( d-> m_model == Model_iPAQ_H31xx ) || 728 if (( d-> m_model == Model_iPAQ_H31xx ) ||
729 ( d-> m_model == Model_iPAQ_H38xx )) { 729 ( d-> m_model == Model_iPAQ_H38xx )) {
730 newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; 730 newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4;
731 } 731 }
732 break; 732 break;
733 } 733 }
734 734
735 // map Power Button short/long press to F34/F35 735 // map Power Button short/long press to F34/F35
736 case Key_SysReq: { 736 case Key_SysReq: {
737 if ( isPress ) { 737 if ( isPress ) {
738 if ( m_power_timer ) 738 if ( m_power_timer )
739 killTimer ( m_power_timer ); 739 killTimer ( m_power_timer );
740 m_power_timer = startTimer ( 500 ); 740 m_power_timer = startTimer ( 500 );
741 } 741 }
742 else if ( m_power_timer ) { 742 else if ( m_power_timer ) {
743 killTimer ( m_power_timer ); 743 killTimer ( m_power_timer );
744 m_power_timer = 0; 744 m_power_timer = 0;
745 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); 745 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false );
746 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); 746 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false );
747 } 747 }
748 newkeycode = Key_unknown; 748 newkeycode = Key_unknown;
749 break; 749 break;
750 } 750 }
751 } 751 }
752 752
753 kif ( newkeycode != keycode ) { 753 if ( newkeycode != keycode ) {
754 if ( newkeycode != Key_unknown ) 754 if ( newkeycode != Key_unknown )
755 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); 755 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
756 return true; 756 return true;
757 } 757 }
758 else 758 else
759 return false; 759 return false;
760} 760}
761 761
762void iPAQ::timerEvent ( QTimerEvent * ) 762void iPAQ::timerEvent ( QTimerEvent * )
763{ 763{
764 killTimer ( m_power_timer ); 764 killTimer ( m_power_timer );
765 m_power_timer = 0; 765 m_power_timer = 0;
766 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false ); 766 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
767 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); 767 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
768} 768}
769 769
770 770
771void iPAQ::alarmSound ( ) 771void iPAQ::alarmSound ( )
772{ 772{
773#ifndef QT_NO_SOUND 773#ifndef QT_NO_SOUND
774 static Sound snd ( "alarm" ); 774 static Sound snd ( "alarm" );
775 int fd; 775 int fd;
776 int vol; 776 int vol;
777 bool vol_reset = false; 777 bool vol_reset = false;
778 778
779 if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { 779 if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) {
780 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { 780 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) {
781 Config cfg ( "qpe" ); 781 Config cfg ( "qpe" );
782 cfg. setGroup ( "Volume" ); 782 cfg. setGroup ( "Volume" );
783 783
784 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 784 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
785 if ( volalarm < 0 ) 785 if ( volalarm < 0 )
786 volalarm = 0; 786 volalarm = 0;
787 else if ( volalarm > 100 ) 787 else if ( volalarm > 100 )
788 volalarm = 100; 788 volalarm = 100;
789 volalarm |= ( volalarm << 8 ); 789 volalarm |= ( volalarm << 8 );
790 790
791 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) 791 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 )
792 vol_reset = true; 792 vol_reset = true;
793 } 793 }
794 } 794 }
795 795
796 snd. play ( ); 796 snd. play ( );
797 while ( !snd. isFinished ( )) 797 while ( !snd. isFinished ( ))
798 qApp-> processEvents ( ); 798 qApp-> processEvents ( );
799 799
800 if ( fd >= 0 ) { 800 if ( fd >= 0 ) {
801 if ( vol_reset ) 801 if ( vol_reset )