-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 87 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 50 |
2 files changed, 92 insertions, 45 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 67dfa41..89b9258 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -1,25 +1,25 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> - =. Copyright (C) 2003-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> + Â Â Â Â Â Â Â Â This file is part of the Opie Project +Â Â Â Â Â Â Â Copyright (C) 2002,2003,2004 The Opie Team <opie-devel@handhelds.org> + =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; +Â Â : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +Â : Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, @@ -240,2 +240,6 @@ void Zaurus::initButtons() + if ( isQWS( ) ) { + addPreHandler(this); + } + d->m_buttons = new QValueList <ODeviceButton>; @@ -593 +597,40 @@ OHingeStatus Zaurus::readHingeSensor() const } + +/* + * 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) { + 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; +} diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 6e6ca46..1fb0cd9 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h @@ -1,25 +1,25 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> - =. Copyright (C) 2003-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> + Â Â Â Â Â Â Â Â This file is part of the Opie Project +Â Â Â Â Â Â Â Copyright (C) 2002,2003,2004 The Opie Team <opie-devel@handhelds.org> + =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; +Â Â : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +Â : Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, @@ -34,2 +34,5 @@ +/* QT */ +#include <qwindowsystem_qws.h> + #ifndef ARRAY_SIZE @@ -93,3 +96,3 @@ namespace Internal { -class Zaurus : public OAbstractMobileDevice +class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter { @@ -121,2 +124,3 @@ class Zaurus : public OAbstractMobileDevice virtual void buzzer( int snd ); + virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |