rendered paste bodyIndex: htcbuthandler.cpp
===================================================================
RCS file: /cvsroot/xanadux/opie2/devices/htcphone/src/plugins/qtopiacore/kbddrivers/htcbuttons/htcbuthandler.cpp,v
retrieving revision 1.3
diff -u -4 -p -r1.3 htcbuthandler.cpp
--- htcbuthandler.cpp 19 May 2007 20:27:19 -0000 1.3
+++ htcbuthandler.cpp 19 May 2007 21:47:07 -0000
@@ -50,8 +50,9 @@
#define PHONE_CALL 65
#define PHONE_HANGUP 66
#define CONTACT_KEY 63
#define CALENDAR_KEY 64
+#define TOGGLE_BACKLIGHT 68
htcButHandler::htcButHandler(const QString &device)
{
qWarning( "***Loaded htc buttons plugin!");
@@ -99,9 +100,9 @@ int htcButHandler::setDevice(const QStri
//qWarning("Opened event0 as button GPIO input");
m_notify = new QSocketNotifier( GpioFD, QSocketNotifier::Read, this );
connect( m_notify, SIGNAL(activated(int)), this, SLOT(readGpioKeys()));
} else {
- qWarning("Cannot open event0 for GPIO buttons (%s)", devName.toLocal8Bit().constData(), strerror(errno));
+ qWarning("Cannot open %s for GPIO buttons (%s)", devName.toLocal8Bit().constData(), strerror(errno));
return 1;
}
}
if (mode == QString("EXT"))
@@ -111,9 +112,9 @@ int htcButHandler::setDevice(const QStri
//qWarning("Opened event0 as button GPIO input");
m_notify = new QSocketNotifier( ExtFD, QSocketNotifier::Read, this );
connect( m_notify, SIGNAL(activated(int)), this, SLOT(readExtKeys()));
} else {
- qWarning("Cannot open event0 for GPIO buttons (%s)", devName.toLocal8Bit().constData(), strerror(errno));
+ qWarning("Cannot open %s for GPIO buttons (%s)", devName.toLocal8Bit().constData(), strerror(errno));
return 1;
}
}
@@ -269,9 +270,12 @@ void htcButHandler::processEvent(htcInpu
case CONTACT_KEY:
key_code = Qt::Key_F10;
unicode = 0xffff;
break;
-
+ case TOGGLE_BACKLIGHT:
+ key_code = Qt::Key_F35;
+ unicode = 0xffff;
+ break;
}
if(shift) modifiers |= Qt::ShiftModifier;
processKeyEvent(unicode, key_code, (Qt::KeyboardModifiers)modifiers,