MCPcopy Create free account
hub / github.com/NetHack/NetHack / NHMenuListWndProc

Function NHMenuListWndProc

outdated/sys/wince/mhmenu.c:1451–1543  ·  view source on GitHub ↗

List window Proc */

Source from the content-addressed store, hash-verified

1449
1450/* List window Proc */
1451LRESULT CALLBACK
1452NHMenuListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
1453{
1454 BOOL bUpdateFocusItem = FALSE;
1455
1456 switch (message) {
1457/* filter keyboard input for the control */
1458#if !defined(WIN_CE_SMARTPHONE)
1459 case WM_KEYDOWN:
1460 case WM_KEYUP: {
1461 MSG msg;
1462
1463 if (PeekMessage(&msg, hWnd, WM_CHAR, WM_CHAR, PM_REMOVE)) {
1464 if (onListChar(GetParent(hWnd), hWnd, (char) msg.wParam) == -2) {
1465 return 0;
1466 }
1467 }
1468
1469 if (wParam == VK_LEFT || wParam == VK_RIGHT)
1470 bUpdateFocusItem = TRUE;
1471 } break;
1472
1473 /* tell Windows not to process arrow keys */
1474 case WM_GETDLGCODE:
1475 return DLGC_WANTARROWS;
1476
1477#else /* defined(WIN_CE_SMARTPHONE) */
1478 case WM_KEYDOWN:
1479 if (wParam == VK_TACTION) {
1480 if (onListChar(GetParent(hWnd), hWnd, ' ') == -2) {
1481 return 0;
1482 }
1483 } else if (NHSPhoneTranslateKbdMessage(wParam, lParam, TRUE)) {
1484 PMSNHEvent evt;
1485 BOOL processed = FALSE;
1486 if (mswin_have_input()) {
1487 evt = mswin_input_pop();
1488 if (evt->type == NHEVENT_CHAR
1489 && onListChar(GetParent(hWnd), hWnd, evt->kbd.ch) == -2) {
1490 processed = TRUE;
1491 }
1492
1493 /* eat the rest of the events */
1494 if (mswin_have_input())
1495 mswin_input_pop();
1496 }
1497 if (processed)
1498 return 0;
1499 }
1500
1501 if (wParam == VK_LEFT || wParam == VK_RIGHT)
1502 bUpdateFocusItem = TRUE;
1503 break;
1504
1505 case WM_KEYUP:
1506 /* translate SmartPhone keyboard message */
1507 if (NHSPhoneTranslateKbdMessage(wParam, lParam, FALSE))
1508 return 0;

Callers

nothing calls this directly

Calls 4

onListCharFunction · 0.70
mswin_have_inputFunction · 0.70
mswin_input_popFunction · 0.70

Tested by

no test coverage detected