author | kergoth <kergoth> | 2003-04-19 20:47:28 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-19 20:47:28 (UTC) |
commit | c502394063598e63591e06072802f1c5a9e0c266 (patch) (side-by-side diff) | |
tree | 66b5e6c888f2370437a399aa8bea7659a04cdb95 | |
parent | eb276a6663540849ef98819eeaa8f935a7e1b945 (diff) | |
download | opie-c502394063598e63591e06072802f1c5a9e0c266.zip opie-c502394063598e63591e06072802f1c5a9e0c266.tar.gz opie-c502394063598e63591e06072802f1c5a9e0c266.tar.bz2 |
Add SL-C700 button handling, so we can handle the keycode for the physical screen rotation.
-rw-r--r-- | libopie/odevice.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 713cc90..cb7dd74 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -41,2 +41,5 @@ +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif @@ -207,2 +210,25 @@ struct z_button { +struct z_button z_buttons_c700 [] = { + { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), + "devicebuttons/z_calendar", + "datebook", "nextView()", + "today", "raise()" }, + { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), + "devicebuttons/z_contact", + "addressbook", "raise()", + "addressbook", "beamBusinessCard()" }, + { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), + "devicebuttons/z_home", + "QPE/Launcher", "home()", + "buttonsettings", "raise()" }, + { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), + "devicebuttons/z_menu", + "QPE/TaskBar", "toggleMenu()", + "QPE/TaskBar", "toggleStartMenu()" }, + { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Display Rotate"), + "", + "QPE/Rotation", "flip()", + "QPE/Rotation", "flip()" }, +}; + static QCString makeChannel ( const char *str ) @@ -1143,2 +1169,3 @@ void Zaurus::init ( ) + bool flipstate = false; switch ( d-> m_model ) { @@ -1148,3 +1175,2 @@ void Zaurus::init ( ) case Model_Zaurus_SLC700: - bool flipstate = false; // Note: need to 1) set flipstate based on physical screen orientation @@ -1182,4 +1208,17 @@ void Zaurus::initButtons ( ) - for ( uint i = 0; i < ( sizeof( z_buttons ) / sizeof( z_button )); i++ ) { - z_button *zb = z_buttons + i; + struct z_button * pz_buttons; + int buttoncount; + switch ( d-> m_model ) { + case Model_Zaurus_SLC700: + pz_buttons = z_buttons_c700; + buttoncount = ARRAY_SIZE(z_buttons_c700); + break; + default: + pz_buttons = z_buttons; + buttoncount = ARRAY_SIZE(z_buttons); + break; + } + + for ( int i = 0; i < buttoncount; i++ ) { + struct z_button *zb = pz_buttons + i; ODeviceButton b; |