| 888 | } |
| 889 | |
| 890 | void InputMap::load_default() { |
| 891 | HashMap<String, List<Ref<InputEvent>>> builtins = get_builtins_with_feature_overrides_applied(); |
| 892 | |
| 893 | for (const KeyValue<String, List<Ref<InputEvent>>> &E : builtins) { |
| 894 | String name = E.key; |
| 895 | |
| 896 | add_action(name); |
| 897 | |
| 898 | const List<Ref<InputEvent>> &inputs = E.value; |
| 899 | for (const List<Ref<InputEvent>>::Element *I = inputs.front(); I; I = I->next()) { |
| 900 | Ref<InputEventKey> iek = I->get(); |
| 901 | |
| 902 | // For the editor, only add keyboard actions. |
| 903 | if (iek.is_valid()) { |
| 904 | action_add_event(name, I->get()); |
| 905 | } |
| 906 | } |
| 907 | } |
| 908 | } |
| 909 | |
| 910 | InputMap::InputMap() { |
| 911 | ERR_FAIL_COND_MSG(singleton, "Singleton in InputMap already exists."); |