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

Function _allow_rebinding

crawl-ref/source/macro.cc:2254–2276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2252}
2253
2254static bool _allow_rebinding(int key, KeymapContext context)
2255{
2256 // CK_REDRAW, CK_MOUSE_CMD, CK_MOUSE_MOVE are covered by `is_synthetic_key`
2257 if (context == KMC_MENU || context == KMC_MENU_MULTISELECT
2258 || context == KMC_TARGETING || context == KMC_LEVELMAP)
2259 {
2260 // prevent rebinding certain keys in popups/menus that would break
2261 // the UI too much. (These can still be modified with a keymap if you
2262 // really do want to break things.)
2263 switch (key)
2264 {
2265 CASE_ESCAPE
2266 case CK_MOUSE_CLICK:
2267 case CK_MOUSE_B2:
2268 return false;
2269 default:
2270 break;
2271 }
2272 // XX possibly need to prevent removing most default KMC_MENU bindings
2273 // so as to not break webtiles?
2274 }
2275 return true;
2276}
2277
2278void bind_command_to_key(command_type cmd, int key)
2279{

Callers 1

bind_command_to_keyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected