MCPcopy Create free account
hub / github.com/crawl/crawl / read_key_code

Function read_key_code

crawl-ref/source/macro.cc:367–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367int read_key_code(string s)
368{
369 if (s.empty())
370 return 0;
371
372 // try human-readable variants
373 int key = _name_to_keycode(s);
374 if (key != CK_NO_KEY)
375 return key;
376
377 int base = 10;
378 if (s[0] == 'x')
379 {
380 s = s.substr(1);
381 base = 16;
382 }
383
384 char *tail;
385 return strtol(s.c_str(), &tail, base);
386}
387
388/*
389 * Takes as argument a string, and returns a sequence of keys described

Callers 3

_bindkeyFunction · 0.85
parse_keyseqFunction · 0.85
process_keyMethod · 0.85

Calls 3

_name_to_keycodeFunction · 0.85
substrMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected