summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 89b9258..59d4eb0 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -229,35 +229,35 @@ void Zaurus::init(const QString& cpu_info)
if ( m_embedix )
qDebug( "Zaurus::init() - Using the Embedix HAL on a %s", (const char*) d->m_modelstr );
else
qDebug( "Zaurus::init() - Using the OpenZaurus HAL on a %s", (const char*) d->m_modelstr );
}
void Zaurus::initButtons()
{
if ( d->m_buttons )
return;
- if ( isQWS( ) ) {
- addPreHandler(this);
- }
d->m_buttons = new QValueList <ODeviceButton>;
struct z_button * pz_buttons;
int buttoncount;
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0:
+ if ( isQWS( ) ) {
+ addPreHandler(this); // hinge-sensor-handler
+ }
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;
@@ -594,43 +594,40 @@ OHingeStatus Zaurus::readHingeSensor() const
qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" );
return CASE_UNKNOWN;
}
}
/*
* Take code from iPAQ device.
* That way we switch the cursor directions depending on status of hinge sensor, eg. hardware direction.
* I hope that is ok - Alwin
*/
bool Zaurus::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat )
{
- Transformation rot;
int newkeycode = keycode;
-
if (d->m_model!=Model_Zaurus_SLC3000 && d->m_model!=Model_Zaurus_SLC7x0) return false;
- rot = rotation();
- if (rot==Rot0) return false;
/* map cursor keys depending on the hinge status */
switch ( keycode ) {
// Rotate cursor keys
case Key_Left :
case Key_Right:
case Key_Up :
case Key_Down :
{
- if (rot==Rot90) {
+ if (rotation()==Rot90) {
newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
}
}
break;
}
if (newkeycode!=keycode) {
if ( newkeycode != Key_unknown ) {
QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
}
return true;
}
return false;
}
+