+ index = m_model->count() - 1;
+ break;
+
+ case Qt::Key_Up:
+ if (m_view->scrollOrientation() == Qt::Horizontal) {
+ if (index > 0) {
+ index--;
+ }
+ }
+ else {
+ // TODO: Move to the previous row
+ }
+ break;
+
+ case Qt::Key_Down:
+ if (m_view->scrollOrientation() == Qt::Horizontal) {
+ if (index < m_model->count() - 1) {
+ index++;
+ }
+ }
+ else {
+ // TODO: Move to the next row
+ }
+ break;
+
+ case Qt::Key_Left:
+ if (m_view->scrollOrientation() == Qt::Vertical) {
+ if (index > 0) {
+ index--;
+ }
+ }
+ else {
+ // TODO: Move to the previous column
+ }
+ break;
+
+ case Qt::Key_Right:
+ if (m_view->scrollOrientation() == Qt::Vertical) {
+ if (index < m_model->count() - 1) {
+ index++;
+ }
+ }
+ else {
+ // TODO: Move to the next column
+ }
+ break;
+
+ case Qt::Key_Space:
+ if (controlPressed) {
+ m_selectionManager->endAnchoredSelection();
+ m_selectionManager->setSelected(index, 1, KItemListSelectionManager::Toggle);
+ m_selectionManager->beginAnchoredSelection(index);
+ }
+ default: