| 2252 | } |
| 2253 | |
| 2254 | static 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 | |
| 2278 | void bind_command_to_key(command_type cmd, int key) |
| 2279 | { |
no outgoing calls
no test coverage detected