summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp8
-rw-r--r--libopie/odevice.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index f93d1ed..a3c30cb 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -144,25 +144,25 @@ struct i_button {
144 "today", "raise()" }, 144 "today", "raise()" },
145 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, 145 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx,
146 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 146 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
147 "devicebuttons/ipaq_contact", 147 "devicebuttons/ipaq_contact",
148 "addressbook", "raise()", 148 "addressbook", "raise()",
149 "addressbook", "beamBusinessCard()" }, 149 "addressbook", "beamBusinessCard()" },
150 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, 150 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx,
151 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 151 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
152 "devicebuttons/ipaq_menu", 152 "devicebuttons/ipaq_menu",
153 "QPE/TaskBar", "toggleMenu()", 153 "QPE/TaskBar", "toggleMenu()",
154 "QPE/TaskBar", "toggleStartMenu()" }, 154 "QPE/TaskBar", "toggleStartMenu()" },
155 { Model_iPAQ_H38xx | Model_iPAQ_H39xx, 155 { Model_iPAQ_H38xx | Model_iPAQ_H39xx,
156 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Mail Button"), 156 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
157 "devicebuttons/ipaq_mail", 157 "devicebuttons/ipaq_mail",
158 "mail", "raise()", 158 "mail", "raise()",
159 "mail", "newMail()" }, 159 "mail", "newMail()" },
160 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, 160 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx,
161 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 161 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
162 "devicebuttons/ipaq_home", 162 "devicebuttons/ipaq_home",
163 "QPE/Launcher", "home()", 163 "QPE/Launcher", "home()",
164 "buttonsettings", "raise()" }, 164 "buttonsettings", "raise()" },
165 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, 165 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx,
166 Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), 166 Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"),
167 "devicebuttons/ipaq_record", 167 "devicebuttons/ipaq_record",
168 "QPE/VMemo", "toggleRecord()", 168 "QPE/VMemo", "toggleRecord()",
@@ -597,36 +597,32 @@ void iPAQ::init ( )
597 597
598 f. close ( ); 598 f. close ( );
599 } 599 }
600 600
601 m_leds [0] = m_leds [1] = Led_Off; 601 m_leds [0] = m_leds [1] = Led_Off;
602 602
603 m_power_timer = 0; 603 m_power_timer = 0;
604 604
605 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { 605 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
606 i_button *ib = ipaq_buttons + i; 606 i_button *ib = ipaq_buttons + i;
607 ODeviceButton b; 607 ODeviceButton b;
608 608
609 qDebug ( "%d: %d", i, ib-> model );
610
611 if (( ib-> model & d-> m_model ) == d-> m_model ) { 609 if (( ib-> model & d-> m_model ) == d-> m_model ) {
612 b. setKeycode ( ib-> code ); 610 b. setKeycode ( ib-> code );
613 b. setUserText ( qApp-> translate ( "Button", ib-> utext )); 611 b. setUserText ( qApp-> translate ( "Button", ib-> utext ));
614 b. setPixmap ( Resource::loadPixmap ( ib-> pix )); 612 b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
615 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); 613 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction ));
616 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); 614 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction ));
617 615
618 d-> m_buttons. append ( b ); 616 d-> m_buttons. append ( b );
619
620 qDebug ( "code: %d", ib-> code );
621 } 617 }
622 } 618 }
623 reloadButtonMapping ( ); 619 reloadButtonMapping ( );
624 620
625 if ( d-> m_qwsserver ) 621 if ( d-> m_qwsserver )
626 QWSServer::setKeyboardFilter ( this ); 622 QWSServer::setKeyboardFilter ( this );
627} 623}
628 624
629//#include <linux/h3600_ts.h> // including kernel headers is evil ... 625//#include <linux/h3600_ts.h> // including kernel headers is evil ...
630 626
631typedef struct { 627typedef struct {
632 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 628 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
@@ -745,25 +741,25 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
745 } 741 }
746 else if ( m_power_timer ) { 742 else if ( m_power_timer ) {
747 killTimer ( m_power_timer ); 743 killTimer ( m_power_timer );
748 m_power_timer = 0; 744 m_power_timer = 0;
749 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); 745 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false );
750 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); 746 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false );
751 } 747 }
752 newkeycode = Key_unknown; 748 newkeycode = Key_unknown;
753 break; 749 break;
754 } 750 }
755 } 751 }
756 752
757 if ( newkeycode != keycode ) { 753 kif ( newkeycode != keycode ) {
758 if ( newkeycode != Key_unknown ) 754 if ( newkeycode != Key_unknown )
759 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); 755 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
760 return true; 756 return true;
761 } 757 }
762 else 758 else
763 return false; 759 return false;
764} 760}
765 761
766void iPAQ::timerEvent ( QTimerEvent * ) 762void iPAQ::timerEvent ( QTimerEvent * )
767{ 763{
768 killTimer ( m_power_timer ); 764 killTimer ( m_power_timer );
769 m_power_timer = 0; 765 m_power_timer = 0;
diff --git a/libopie/odevice.h b/libopie/odevice.h
index ce62f1a..54b85a2 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -74,25 +74,25 @@ enum OLedState {
74 74
75enum OLed { 75enum OLed {
76 Led_Mail, 76 Led_Mail,
77 Led_Power, 77 Led_Power,
78 Led_BlueTooth 78 Led_BlueTooth
79}; 79};
80 80
81enum OHardKey { 81enum OHardKey {
82 HardKey_Datebook = Qt::Key_F9, 82 HardKey_Datebook = Qt::Key_F9,
83 HardKey_Contacts = Qt::Key_F10, 83 HardKey_Contacts = Qt::Key_F10,
84 HardKey_Menu = Qt::Key_F11, 84 HardKey_Menu = Qt::Key_F11,
85 HardKey_Home = Qt::Key_F12, 85 HardKey_Home = Qt::Key_F12,
86 HardKey_Mail = Qt::Key_F14, 86 HardKey_Mail = Qt::Key_F13,
87 HardKey_Record = Qt::Key_F24, 87 HardKey_Record = Qt::Key_F24,
88 HardKey_Suspend = Qt::Key_F34, 88 HardKey_Suspend = Qt::Key_F34,
89 HardKey_Backlight = Qt::Key_F35, 89 HardKey_Backlight = Qt::Key_F35,
90}; 90};
91 91
92 92
93class ODevice : public QObject { 93class ODevice : public QObject {
94 Q_OBJECT 94 Q_OBJECT
95 95
96private: 96private:
97 ODevice ( const ODevice & ); 97 ODevice ( const ODevice & );
98 98