summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ipaq.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 9e01a0c..2ce38a9 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -291,117 +291,96 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
// map Power Button short/long press to F34/F35
case Key_SysReq: {
if ( isPress ) {
if ( m_power_timer )
killTimer ( m_power_timer );
m_power_timer = startTimer ( 500 );
}
else if ( m_power_timer ) {
killTimer ( m_power_timer );
m_power_timer = 0;
QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false );
QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false );
}
newkeycode = Key_unknown;
break;
}
}
if ( newkeycode != keycode ) {
if ( newkeycode != Key_unknown )
QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
return true;
}
else
return false;
}
void iPAQ::timerEvent ( QTimerEvent * )
{
killTimer ( m_power_timer );
m_power_timer = 0;
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
}
void iPAQ::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
if(!snd.isFinished())
return;
changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
snd. play();
#endif
}
-
-bool iPAQ::setSoftSuspend ( bool soft )
-{
- bool res = false;
- int fd;
-
- if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) {
- if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 )
- res = true;
- else
- ::perror ( "write to /proc/sys/ts/suspend_button_mode" );
-
- ::close ( fd );
- }
- else
- ::perror ( "/proc/sys/ts/suspend_button_mode" );
-
- return res;
-}
-
-
bool iPAQ::setDisplayBrightness ( int bright )
{
bool res = false;
int fd;
if ( bright > 255 )
bright = 255;
if ( bright < 0 )
bright = 0;
if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
FLITE_IN bl;
bl. mode = 1;
bl. pwr = bright ? 1 : 0;
bl. brightness = ( bright * ( displayBrightnessResolution() - 1 ) + 127 ) / 255;
res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 );
::close ( fd );
}
return res;
}
int iPAQ::displayBrightnessResolution() const
{
switch ( model()) {
case Model_iPAQ_H31xx:
case Model_iPAQ_H36xx:
case Model_iPAQ_H37xx:
return 128; // really 256, but >128 could damage the LCD
case Model_iPAQ_H38xx:
case Model_iPAQ_H39xx:
return 64;
case Model_iPAQ_H5xxx:
return 255;
default:
return 2;
}
}
bool iPAQ::hasLightSensor() const
{
return true;
}
int iPAQ::readLightSensor()
{