aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-09-04 15:55:21 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-26 11:39:22 +0200
commitd8ce4215f74e71b4328f090e6b6bb5493d8df754 (patch)
tree5d53e248741bbcb596a238668f993490188a42a6 /ui
parentmod: bump (diff)
downloadwireguard-windows-d8ce4215f74e71b4328f090e6b6bb5493d8df754.tar.xz
wireguard-windows-d8ce4215f74e71b4328f090e6b6bb5493d8df754.zip
ui: allow (Shift+)Tab to move focus to sibling controls in RichEdit
With RTF control consuming Tab and Enter keystrokes, there was no way to create or edit a tunnel using keyboard only. This was a major concern for accessibility. Should user want to explicitly insert \t into configuration, one can use Ctrl+Tab, paste it, or use Alt+09 (on numeric keyboard). Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'ui')
-rw-r--r--ui/syntax/syntaxedit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/syntax/syntaxedit.c b/ui/syntax/syntaxedit.c
index 70ebca63..2e53b011 100644
--- a/ui/syntax/syntaxedit.c
+++ b/ui/syntax/syntaxedit.c
@@ -362,6 +362,14 @@ static LRESULT CALLBACK child_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lP
case WM_THEMECHANGED:
highlight_text(hWnd);
break;
+ case WM_GETDLGCODE: {
+ MSG *m = (MSG *)lParam;
+ LRESULT lres = parent_proc(hWnd, Msg, wParam, lParam);
+ lres &= ~DLGC_WANTTAB;
+ if (m && m->message == WM_KEYDOWN && m->wParam == VK_TAB && GetKeyState(VK_CONTROL) >= 0)
+ lres &= ~DLGC_WANTMESSAGE;
+ return lres;
+ }
}
return parent_proc(hWnd, Msg, wParam, lParam);
}