MCPcopy Create free account
hub / github.com/buggins/coolreader / loadPocketBookKeyMaps

Function loadPocketBookKeyMaps

cr3gui/src/cr3pocketbook.cpp:2300–2327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2298}
2299
2300static void loadPocketBookKeyMaps(CRGUIWindowManager & winman)
2301{
2302 CRGUIAcceleratorTable pbTable;
2303 int commandId, commandParam;
2304
2305 char *keypress[32], *keypresslong[32];
2306 GetKeyMapping(keypress, keypresslong);
2307
2308 for (int i = 0; i < 32; i++) {
2309 if (keypress[i]) {
2310 CRPocketBookWindowManager::instance->getPocketBookCommand(keypress[i], commandId, commandParam);
2311 CRLog::trace("keypress[%d] = %s, cmd = %d, param=%d", i, keypress[i], commandId, commandParam);
2312 if (commandId != -1)
2313 pbTable.add(i, 0, commandId, commandParam);
2314 }
2315 if (keypresslong[i]) {
2316 CRPocketBookWindowManager::instance->getPocketBookCommand(keypresslong[i], commandId, commandParam);
2317 CRLog::trace("keypresslong[%d] = %s, cmd = %d, param=%d", i, keypresslong[i], commandId, commandParam);
2318 if (commandId != -1)
2319 pbTable.add(i, 1, commandId, commandParam);
2320 }
2321 }
2322 CRGUIAcceleratorTableRef mainTable = winman.getAccTables().get("main");
2323 if (!mainTable.isNull()) {
2324 CRLog::trace("main accelerator table is not null");
2325 mainTable->addAll(pbTable);
2326 }
2327}
2328
2329
2330int InitDoc(const char *exename, char *fileName)

Callers 1

InitDocFunction · 0.85

Calls 5

getPocketBookCommandMethod · 0.80
addMethod · 0.45
getMethod · 0.45
isNullMethod · 0.45
addAllMethod · 0.45

Tested by

no test coverage detected