diff options
| author | Pietro Gagliardi <[email protected]> | 2014-11-12 22:48:04 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-11-12 22:48:04 -0500 |
| commit | 922097985b47a20789adfbe0ff287037034a99e6 (patch) | |
| tree | 4ccc43383071a739c3685b3e4a9950db16900f75 /wintable/main.c | |
| parent | 2b8f0635a0265565a7341cd57c85cfdec86b97e3 (diff) | |
Added keyboard navigation for columns in the new Windows Table.
Diffstat (limited to 'wintable/main.c')
| -rw-r--r-- | wintable/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/wintable/main.c b/wintable/main.c index 1703071..6fbc9a4 100644 --- a/wintable/main.c +++ b/wintable/main.c @@ -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; |
