MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / get_key_value

Method get_key_value

linux/lnxcontroller.cpp:1348–1373  ·  view source on GitHub ↗

get keyboard info

Source from the content-addressed store, hash-verified

1346
1347// get keyboard info
1348float lnxgameController::get_key_value(int key, ct_format format) {
1349 float val = (float)0.0;
1350
1351 ASSERT(key < DDIO_MAX_KEYS);
1352
1353 switch (format) {
1354 // note we take care of mouse controls and external controls here
1355 case ctDigital:
1356 if (KEY_STATE(key))
1357 val = 1.0f;
1358 break;
1359
1360 case ctDownCount:
1361 val = (float)ddio_KeyDownCount(key);
1362 break;
1363
1364 case ctTime:
1365 val = (float)ddio_KeyDownTime(key);
1366 break;
1367
1368 default:
1369 mprintf(1, "gameController::key unsupported format for function\n");
1370 }
1371
1372 return val;
1373}
1374
1375// CTL file parser
1376#define N_CTLCMDS 9

Callers

nothing calls this directly

Calls 2

ddio_KeyDownCountFunction · 0.85
ddio_KeyDownTimeFunction · 0.85

Tested by

no test coverage detected