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

Function NHSPhoneTranslateKbdMessage

outdated/sys/wince/mhcmd.c:1334–1403  ·  view source on GitHub ↗

special keypad input handling for SmartPhone the phone keypad maps to VK_* as shown below. some keys might not be present, e.g. VK_TFLIP sofkey1 softkey2 VK_TSOFT1, VK_TSOFT2 ^ VK_TUP < + > VK_TLEFT, VK_TACTION, VK_TRIGHT v VK_TDOWN home back VK_THOME, VK_TBACK talk end V

Source from the content-addressed store, hash-verified

1332 VK_TFLIP
1333*/
1334BOOL
1335NHSPhoneTranslateKbdMessage(WPARAM wParam, LPARAM lParam, BOOL keyDown)
1336{
1337 PNHCmdWindow data;
1338 int index = -1;
1339
1340 /* get window data */
1341 data = (PNHCmdWindow) GetWindowLong(GetNHApp()->hCmdWnd, GWL_USERDATA);
1342 if (!data)
1343 return FALSE;
1344
1345 switch (wParam) {
1346 case VK_T0:
1347 index = 10;
1348 break;
1349
1350 case VK_T1:
1351 index = 0;
1352 break;
1353
1354 case VK_T2:
1355 index = 1;
1356 break;
1357
1358 case VK_T3:
1359 index = 2;
1360 break;
1361
1362 case VK_T4:
1363 index = 3;
1364 break;
1365
1366 case VK_T5:
1367 index = 4;
1368 break;
1369
1370 case VK_T6:
1371 index = 5;
1372 break;
1373
1374 case VK_T7:
1375 index = 6;
1376 break;
1377
1378 case VK_T8:
1379 index = 7;
1380 break;
1381
1382 case VK_T9:
1383 index = 8;
1384 break;
1385
1386 case VK_TSTAR:
1387 index = 9;
1388 break;
1389
1390 case VK_TPOUND:
1391 index = 11;

Callers 2

MainWndProcFunction · 0.85
NHMenuListWndProcFunction · 0.85

Calls 3

HighlightCellFunction · 0.85
ActivateCellFunction · 0.85
GetNHAppFunction · 0.70

Tested by

no test coverage detected