--- a/dirbrowser/cdbrowser.cpp
+++ b/dirbrowser/cdbrowser.cpp
@@ -139,6 +139,21 @@
QWEBVIEW::mouseReleaseEvent(event);
}
+// Alphabetic key presses have the same effect as clicking one of the
+// alphabet links.
+void CDBrowser::keyPressEvent(QKeyEvent *e)
+{
+ /* We happen to know that the Key_X event value is the ascii character */
+ unsigned char val =(unsigned char)e->key();
+ if (val >= 'A' && val <= 'Z') {
+ QString surl("http://h/a");
+ surl += QString(val);
+ QUrl url(surl);
+ onLinkClicked(url);
+ }
+ QWEBVIEW::keyPressEvent(e);
+}
+
void CDBrowser::onContentsSizeChanged(const QSize&)
{
//qDebug() << "CDBrowser::onContentsSizeChanged: scrollpos " <<
@@ -297,7 +312,7 @@
return;
}
scurl = scurl.substr(9);
- LOGDEB("CDBrowser::onLinkClicked: corrected url: [" << scurl << "]" <<endl);
+ qDebug() << "CDBrowser::onLinkClicked: corrected url: " << scurl.c_str();;
int what = scurl[0];