@@ -0,0 +1,1908 @@
+%0Apackage org.terasology.documentation;%0A%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0Aimport java.util.TreeMap;%0A%0Aimport org.terasology.engine.module.ModuleManager;%0Aimport org.terasology.input.DefaultBinding;%0Aimport org.terasology.input.Input;%0Aimport org.terasology.input.InputType;%0Aimport org.terasology.input.RegisterBindButton;%0Aimport org.terasology.testUtil.ModuleManagerFactory;%0A%0Aimport com.google.common.collect.TreeBasedTable;%0A%0A/**%0A * Enumerates all default key bindings and writes them sorted by ID to the console%0A */%0Apublic class BindingScraper%0A%7B%0A    /**%0A     * @param args (ignored)%0A     * @throws Exception if the module environment cannot be loaded%0A     */%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        ModuleManager moduleManager = ModuleManagerFactory.create();%0A%0A        TreeBasedTable%3CString, Input, String%3E keyTable = TreeBasedTable.create(%0A                String.CASE_INSENSITIVE_ORDER,%0A                (i1, i2) -%3E Integer.compare(i1.getId(), i2.getId()));%0A%0A        for (Class%3C?%3E buttonEvent : moduleManager.getEnvironment().getTypesAnnotatedWith(RegisterBindButton.class)) %7B%0A            DefaultBinding defBinding = buttonEvent.getAnnotation(DefaultBinding.class);%0A            if (defBinding != null) %7B%0A                if (defBinding.type() == InputType.KEY) %7B%0A                    Input input = InputType.KEY.getInput(defBinding.id());%0A%0A                    RegisterBindButton info = buttonEvent.getAnnotation(RegisterBindButton.class);%0A                    keyTable.put(info.category(), input, info.description());%0A                %7D%0A            %7D%0A        %7D%0A%0A        for (String row : keyTable.rowKeySet()) %7B%0A            System.out.println(%22# %22 + row);%0A            for (Entry%3CInput, String%3E entry : keyTable.row(row).entrySet()) %7B%0A                System.out.println(%22%60%22 + entry.getKey().getDisplayName() + %22%60 : %22 + entry.getValue());%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add utility to extract default bindings from code