summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2005-02-04 17:59:22 (UTC)
committer mickeyl <mickeyl>2005-02-04 17:59:22 (UTC)
commitee4b479d3e0b67a4418914231c0ec38ef31b8290 (patch) (side-by-side diff)
treeb4bde4c8544444d260f98619bf82a0c5ec8a584e /libopie2
parentc0248a2c02381b5a5dce5c4543db6ff46486f2f1 (diff)
downloadopie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.zip
opie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.tar.gz
opie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.tar.bz2
implement computing the hinge status for Zaurus w/ Kernel 2.6
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 780d130..a59e799 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -36,6 +36,7 @@
#include <qwindowsystem_qws.h>
/* OPIE */
+#include <opie2/oinputsystem.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include <qpe/sound.h>
@@ -100,7 +101,16 @@ struct z_button z_buttons_c700 [] = {
"devicebuttons/z_mail",
"opiemail", "raise()",
"opiemail", "newMail()" },
- { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
+
+ { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
+ "devicebuttons/z_hinge",
+ "QPE/Rotation", "rotateDefault()",
+ "QPE/Dummy", "doNothing()" },
+ { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
+ "devicebuttons/z_hinge",
+ "QPE/Rotation", "rotateDefault()",
+ "QPE/Dummy", "doNothing()" },
+ { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
"devicebuttons/z_hinge",
"QPE/Rotation", "rotateDefault()",
"QPE/Dummy", "doNothing()" },
@@ -507,7 +517,7 @@ bool Zaurus::suspend()
Transformation Zaurus::rotation() const
{
Transformation rot;
-
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0: {
@@ -532,7 +542,7 @@ Transformation Zaurus::rotation() const
ODirection Zaurus::direction() const
{
ODirection dir;
-
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0: {
@@ -587,7 +597,12 @@ OHingeStatus Zaurus::readHingeSensor() const
}
else
{
- qDebug( "Zaurus::readHingeSensor: ODevice handling for non-embedix kernels not yet implemented" );
+ // corgi keyboard is event source 0 in OZ kernel 2.6
+ OInputDevice* keyboard = OInputSystem::instance()->device( "event0" );
+ if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP0 ) ) return CASE_LANDSCAPE;
+ else if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP1 ) ) return CASE_PORTRAIT;
+ else if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP2 ) ) return CASE_CLOSED;
+ qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" );
return CASE_UNKNOWN;
}
}