add etcpmon keyboard navigation: Tab between Server/Port, Enter=Connect, Esc=Disconnect
This commit is contained in:
1 parent
3a9c27de85
commit
6936f09fad
1 file changed
+25
@@ -972,6 +972,31 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
if (app) {
|
||||
switch (wParam) {
|
||||
case VK_TAB: {
|
||||
HWND hFocus = GetFocus();
|
||||
if (hFocus == app->hEditAddr) {
|
||||
SetFocus(app->hEditPort);
|
||||
int len = GetWindowTextLengthA(app->hEditPort);
|
||||
SendMessageA(app->hEditPort, EM_SETSEL, len, len);
|
||||
} else if (hFocus == app->hEditPort) {
|
||||
SetFocus(app->hEditAddr);
|
||||
int len = GetWindowTextLengthA(app->hEditAddr);
|
||||
SendMessageA(app->hEditAddr, EM_SETSEL, len, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case VK_RETURN:
|
||||
if (!app->isConnected) OnConnect(app);
|
||||
return 0;
|
||||
case VK_ESCAPE:
|
||||
if (app->isConnected) OnDisconnect(app);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
|
||||
Reference in new issue
Block a user