Added keyboard navigation for columns in the new Windows Table.

This commit is contained in:
Pietro Gagliardi 2014-11-12 22:48:04 -05:00
parent 2b8f0635a0
commit 922097985b
1 changed files with 17 additions and 0 deletions

View File

@ -336,6 +336,23 @@ static void keySelect(struct table *t, WPARAM wParam, LPARAM lParam)
case VK_END:
t->selected = t->count - 1;
break;
case VK_LEFT:
t->focusedColumn--;
if (t->focusedColumn < 0)
if (t->nColumns == 0) // peg at -1
t->focusedColumn = -1;
else
t->focusedColumn = 0;
break;
case VK_RIGHT:
t->focusedColumn++;
if (t->focusedColumn >= t->nColumns)
if (t->nColumns == 0) // peg at -1
t->focusedColumn = -1;
else
t->focusedColumn = t->nColumns - 1;
break;
// TODO keyboard shortcuts for going to the first/last column?
default:
// don't touch anything
return;