import bpy
import os

def kmi_props_setattr(kmi_props, attr, value):
    try:
        setattr(kmi_props, attr, value)
    except AttributeError:
        print("Warning: property '%s' not found in keymap item '%s'" %
              (attr, kmi_props.__class__.__name__))
    except Exception as e:
        print("Warning: %r" % e)

wm = bpy.context.window_manager
kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])

# Map Window
km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'S', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.saveopen')
kmi = km.keymap_items.new('wm.window_duplicate', 'W', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_file_open_recent')
kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.open_mainfile', 'F1', 'PRESS')
kmi = km.keymap_items.new('wm.link', 'O', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.append', 'F1', 'PRESS', shift=True)
kmi = km.keymap_items.new('wm.save_mainfile', 'S', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.save_mainfile', 'W', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('wm.save_as_mainfile', 'F2', 'PRESS')
kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'copy', True)
kmi = km.keymap_items.new('wm.window_fullscreen_toggle', 'F11', 'PRESS', alt=True)
kmi = km.keymap_items.new('wm.quit_blender', 'Q', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.doc_view_manual_ui_context', 'F1', 'PRESS', alt=True)
kmi = km.keymap_items.new('wm.redraw_timer', 'T', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.debug_menu', 'D', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.search_menu', 'SPACE', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.call_menu', 'NDOF_BUTTON_MENU', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'USERPREF_MT_ndof_settings')
kmi = km.keymap_items.new('wm.context_set_enum', 'F2', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'LOGIC_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F3', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'NODE_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F4', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'CONSOLE')
kmi = km.keymap_items.new('wm.context_set_enum', 'F5', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'VIEW_3D')
kmi = km.keymap_items.new('wm.context_set_enum', 'F6', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'GRAPH_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F7', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'PROPERTIES')
kmi = km.keymap_items.new('wm.context_set_enum', 'F8', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'SEQUENCE_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F9', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'OUTLINER')
kmi = km.keymap_items.new('wm.context_set_enum', 'F10', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'IMAGE_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F11', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'TEXT_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'F12', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'area.type')
kmi_props_setattr(kmi.properties, 'value', 'DOPESHEET_EDITOR')
kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_PLUS', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity')
kmi_props_setattr(kmi.properties, 'value', 1.100000023841858)
kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_MINUS', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity')
kmi_props_setattr(kmi.properties, 'value', 0.9090908765792847)
kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_PLUS', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity')
kmi_props_setattr(kmi.properties, 'value', 1.5)
kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_MINUS', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity')
kmi_props_setattr(kmi.properties, 'value', 0.6666666865348816)
kmi = km.keymap_items.new('info.reports_display_update', 'TIMER_REPORT', 'ANY', any=True)

# Map 3D View Generic
km = kc.keymaps.new('3D View Generic', space_type='VIEW_3D', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'Q', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.pivotpoint')
kmi = km.keymap_items.new('wm.call_menu_pie', 'Z', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.objectshading')
kmi = km.keymap_items.new('wm.call_menu_pie', 'Z', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.shadingview')
kmi = km.keymap_items.new('wm.call_menu_pie', 'SPACE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.orientation')
kmi = km.keymap_items.new('wm.call_menu_pie', 'TAB', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.snapping')
kmi = km.keymap_items.new('wm.call_menu_pie', 'SPACE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.manipulator')
kmi = km.keymap_items.new('wm.call_menu_pie', 'S', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.originpivot')
kmi = km.keymap_items.new('wm.call_menu_pie', 'Q', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.viewnumpad')
kmi.active = False
kmi = km.keymap_items.new('view3d.properties', 'N', 'PRESS')
kmi = km.keymap_items.new('view3d.toolshelf', 'T', 'PRESS')

# Map Object Mode
km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('hops.slash', 'NUMPAD_SLASH', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('hops.bool_difference', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('hops.bool_union', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.call_menu_pie', 'A', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.selectionsom')
kmi = km.keymap_items.new('wm.call_menu_pie', 'A', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.applytranforms')
kmi = km.keymap_items.new('wm.call_menu_pie', 'O', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.proportional_obj')
kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff')
kmi_props_setattr(kmi.properties, 'wrap', True)
kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_proportional_edit_objects')
kmi = km.keymap_items.new('view3d.game_start', 'P', 'PRESS')
kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS')
kmi_props_setattr(kmi.properties, 'action', 'TOGGLE')
kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'action', 'INVERT')
kmi = km.keymap_items.new('object.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True)
kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True)
kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS')
kmi_props_setattr(kmi.properties, 'direction', 'PARENT')
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'direction', 'PARENT')
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS')
kmi_props_setattr(kmi.properties, 'direction', 'CHILD')
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'direction', 'CHILD')
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('object.parent_clear', 'P', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.track_set', 'T', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.track_clear', 'T', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('object.location_clear', 'G', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', False)
kmi = km.keymap_items.new('object.rotation_clear', 'R', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', False)
kmi = km.keymap_items.new('object.scale_clear', 'S', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', False)
kmi = km.keymap_items.new('object.location_clear', 'G', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', True)
kmi = km.keymap_items.new('object.rotation_clear', 'R', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', True)
kmi = km.keymap_items.new('object.scale_clear', 'S', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'clear_delta', True)
kmi = km.keymap_items.new('object.origin_clear', 'O', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.hide_view_clear', 'H', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS')
kmi_props_setattr(kmi.properties, 'unselected', False)
kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'unselected', True)
kmi = km.keymap_items.new('object.hide_render_clear', 'H', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('object.hide_render_set', 'H', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS')
kmi = km.keymap_items.new('object.delete', 'X', 'PRESS')
kmi_props_setattr(kmi.properties, 'use_global', False)
kmi = km.keymap_items.new('object.delete', 'X', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'use_global', True)
kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS')
kmi_props_setattr(kmi.properties, 'use_global', False)
kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'use_global', True)
kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_add')
kmi = km.keymap_items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_object_apply')
kmi = km.keymap_items.new('wm.call_menu', 'U', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_make_single_user')
kmi = km.keymap_items.new('wm.call_menu', 'L', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_make_links')
kmi = km.keymap_items.new('object.duplicate_move', 'D', 'PRESS', shift=True)
kmi = km.keymap_items.new('object.duplicate_move_linked', 'D', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.join', 'J', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('object.convert', 'C', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('object.make_local', 'L', 'PRESS')
kmi = km.keymap_items.new('anim.keyframe_insert_menu', 'I', 'PRESS')
kmi = km.keymap_items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True)
kmi = km.keymap_items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('group.create', 'G', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('group.objects_remove', 'G', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('group.objects_remove_all', 'G', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('group.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('group.objects_remove_active', 'G', 'PRESS', shift=True, alt=True)
kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_object_specials')
kmi = km.keymap_items.new('object.data_transfer', 'T', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS')
kmi_props_setattr(kmi.properties, 'level', 0)
kmi.active = False
kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS')
kmi_props_setattr(kmi.properties, 'level', 1)
kmi.active = False
kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS')
kmi_props_setattr(kmi.properties, 'level', 2)
kmi.active = False
kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 3)
kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 4)
kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 5)
kmi = km.keymap_items.new('view3d.layers', 'ONE', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'TWO', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'THREE', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'FOUR', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'FIVE', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'SIX', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'SEVEN', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'EIGHT', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'NINE', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.layers', 'ZERO', 'PRESS', any=True)
kmi = km.keymap_items.new('view3d.camera_to_view', 'NUMPAD_0', 'PRESS', ctrl=True, alt=True)

# Map Image Paint
km = kc.keymaps.new('Image Paint', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'W', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.texturepaint')
kmi = km.keymap_items.new('paint.image_paint', 'LEFTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'NORMAL')
kmi = km.keymap_items.new('paint.image_paint', 'LEFTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'mode', 'INVERT')
kmi = km.keymap_items.new('paint.brush_colors_flip', 'X', 'PRESS')
kmi = km.keymap_items.new('paint.grab_clone', 'RIGHTMOUSE', 'PRESS')
kmi = km.keymap_items.new('paint.sample_color', 'S', 'PRESS')
kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 0)
kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 1)
kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 2)
kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 3)
kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 4)
kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 5)
kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 6)
kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 7)
kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 8)
kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 9)
kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 10)
kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 11)
kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 12)
kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 13)
kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 14)
kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 15)
kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 16)
kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 17)
kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 18)
kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'image_paint')
kmi_props_setattr(kmi.properties, 'index', 19)
kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS')
kmi_props_setattr(kmi.properties, 'scalar', 0.8999999761581421)
kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS')
kmi_props_setattr(kmi.properties, 'scalar', 1.1111111640930176)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.size')
kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size')
kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', 'space_data.zoom')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', True)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.strength')
kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength')
kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', True)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'data_path_secondary', '')
kmi_props_setattr(kmi.properties, 'use_secondary', '')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', False)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.mask_texture_slot.angle')
kmi_props_setattr(kmi.properties, 'data_path_secondary', '')
kmi_props_setattr(kmi.properties, 'use_secondary', '')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', True)
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'SCALE')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'mode', 'ROTATION')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'SCALE')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'ROTATION')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'image_paint_object.data.use_paint_mask')
kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.image_paint.brush.use_smooth_stroke')
kmi = km.keymap_items.new('wm.call_menu', 'R', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_angle_control')
kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.image_paint.brush.stroke_method')

# Map Vertex Paint
km = kc.keymaps.new('Vertex Paint', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('paint.vertex_paint', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('paint.sample_color', 'S', 'PRESS')
kmi = km.keymap_items.new('paint.vertex_color_set', 'K', 'PRESS', shift=True)
kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 0)
kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 1)
kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 2)
kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 3)
kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 4)
kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 5)
kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 6)
kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 7)
kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 8)
kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 9)
kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 10)
kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 11)
kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 12)
kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 13)
kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 14)
kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 15)
kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 16)
kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 17)
kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 18)
kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint')
kmi_props_setattr(kmi.properties, 'index', 19)
kmi = km.keymap_items.new('brush.scale_size', 'SEMI_COLON', 'PRESS')
kmi_props_setattr(kmi.properties, 'scalar', 0.8999999761581421)
kmi = km.keymap_items.new('brush.scale_size', 'EQUAL', 'PRESS')
kmi_props_setattr(kmi.properties, 'scalar', 1.1111111640930176)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.size')
kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size')
kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', False)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.strength')
kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength')
kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', False)
kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'data_path_secondary', '')
kmi_props_setattr(kmi.properties, 'use_secondary', '')
kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle')
kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add')
kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color')
kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color')
kmi_props_setattr(kmi.properties, 'zoom_path', '')
kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush')
kmi_props_setattr(kmi.properties, 'secondary_tex', False)
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'mode', 'SCALE')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'mode', 'ROTATION')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'SCALE')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'mode', 'ROTATION')
kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY')
kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'vertex_paint_object.data.use_paint_mask')
kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.vertex_paint.brush.use_smooth_stroke')
kmi = km.keymap_items.new('wm.call_menu', 'R', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_angle_control')
kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.vertex_paint.brush.stroke_method')

# Map Mesh
km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('hops.edit_bool_difference', 'NUMPAD_MINUS', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('hops.edit_bool_union', 'NUMPAD_PLUS', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.call_menu_pie', 'A', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.selectionsem')
kmi = km.keymap_items.new('wm.call_menu_pie', 'X', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.delete')
kmi = km.keymap_items.new('wm.call_menu_pie', 'X', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.align')
kmi = km.keymap_items.new('wm.call_menu_pie', 'O', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.proportional_edt')
kmi = km.keymap_items.new('mesh.loopcut_slide', 'R', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.offset_edge_loops_slide', 'R', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('mesh.inset', 'I', 'PRESS')
kmi = km.keymap_items.new('mesh.poke', 'P', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.bevel', 'B', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'vertex_only', False)
kmi = km.keymap_items.new('mesh.bevel', 'B', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'vertex_only', True)
kmi = km.keymap_items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi_props_setattr(kmi.properties, 'toggle', False)
kmi = km.keymap_items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi = km.keymap_items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi_props_setattr(kmi.properties, 'toggle', False)
kmi = km.keymap_items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi = km.keymap_items.new('mesh.shortest_path_pick', 'SELECTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'use_fill', False)
kmi = km.keymap_items.new('mesh.shortest_path_pick', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'use_fill', True)
kmi = km.keymap_items.new('mesh.select_all', 'A', 'PRESS')
kmi_props_setattr(kmi.properties, 'action', 'TOGGLE')
kmi = km.keymap_items.new('mesh.select_all', 'I', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'action', 'INVERT')
kmi = km.keymap_items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.select_next_item', 'NUMPAD_PLUS', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('mesh.select_prev_item', 'NUMPAD_MINUS', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS')
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'deselect', True)
kmi = km.keymap_items.new('mesh.faces_select_linked_flat', 'F', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_select_similar')
kmi = km.keymap_items.new('wm.call_menu', 'RIGHTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_select_mode')
kmi.active = False
kmi = km.keymap_items.new('mesh.hide', 'H', 'PRESS')
kmi_props_setattr(kmi.properties, 'unselected', False)
kmi = km.keymap_items.new('mesh.hide', 'H', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'unselected', True)
kmi = km.keymap_items.new('mesh.reveal', 'H', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'inside', False)
kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'inside', True)
kmi = km.keymap_items.new('view3d.edit_mesh_extrude_move_normal', 'E', 'PRESS')
kmi = km.keymap_items.new('wm.call_menu', 'E', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_extrude')
kmi = km.keymap_items.new('transform.edge_crease', 'E', 'PRESS', shift=True)
kmi = km.keymap_items.new('mesh.spin', 'R', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.fill', 'F', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True)
kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'quad_method', 'BEAUTY')
kmi_props_setattr(kmi.properties, 'ngon_method', 'BEAUTY')
kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'quad_method', 'FIXED')
kmi_props_setattr(kmi.properties, 'ngon_method', 'CLIP')
kmi = km.keymap_items.new('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.rip_move', 'V', 'PRESS')
kmi = km.keymap_items.new('mesh.rip_move_fill', 'V', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.rip_edge_move', 'D', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.merge', 'M', 'PRESS', alt=True)
kmi = km.keymap_items.new('transform.shrink_fatten', 'S', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.edge_face_add', 'F', 'PRESS')
kmi = km.keymap_items.new('mesh.duplicate_move', 'D', 'PRESS', shift=True)
kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_mesh_add')
kmi = km.keymap_items.new('mesh.separate', 'P', 'PRESS')
kmi = km.keymap_items.new('mesh.split', 'Y', 'PRESS')
kmi = km.keymap_items.new('mesh.vert_connect_path', 'J', 'PRESS')
kmi = km.keymap_items.new('transform.vert_slide', 'V', 'PRESS', shift=True)
kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True)
kmi_props_setattr(kmi.properties, 'rotate_source', True)
kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'rotate_source', False)
kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_delete')
kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_delete')
kmi = km.keymap_items.new('mesh.dissolve_mode', 'X', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.dissolve_mode', 'DEL', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.knife_tool', 'K', 'PRESS')
kmi_props_setattr(kmi.properties, 'use_occlude_geometry', True)
kmi_props_setattr(kmi.properties, 'only_selected', False)
kmi = km.keymap_items.new('mesh.knife_tool', 'K', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'use_occlude_geometry', False)
kmi_props_setattr(kmi.properties, 'only_selected', True)
kmi = km.keymap_items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_specials')
kmi = km.keymap_items.new('wm.call_menu', 'F', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_faces')
kmi = km.keymap_items.new('wm.call_menu', 'E', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_edges')
kmi = km.keymap_items.new('wm.call_menu', 'V', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_vertices')
kmi = km.keymap_items.new('wm.call_menu', 'H', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_hook')
kmi = km.keymap_items.new('wm.call_menu', 'U', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_uv_map')
kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_vertex_group')
kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 0)
kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 1)
kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 2)
kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 3)
kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 4)
kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'level', 5)
kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff')
kmi_props_setattr(kmi.properties, 'wrap', True)
kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit')
kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED')
kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED')
kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit')
kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED')
kmi_props_setattr(kmi.properties, 'value_2', 'CONNECTED')
kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_select_mode')
kmi = km.keymap_items.new('mesh.select_mode', 'F1', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'VERT')
kmi = km.keymap_items.new('mesh.select_mode', 'F2', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'EDGE')
kmi = km.keymap_items.new('mesh.select_mode', 'F3', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'FACE')
kmi = km.keymap_items.new('mesh.loop_multi_select', 'C', 'PRESS')
kmi_props_setattr(kmi.properties, 'ring', False)
kmi = km.keymap_items.new('mesh.select_linked', 'BACK_SLASH', 'PRESS')
kmi = km.keymap_items.new('mesh.separate', 'S', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'type', 'SELECTED')
kmi = km.keymap_items.new('mesh.triangulate', 'T', 'PRESS', alt=True)
kmi = km.keymap_items.new('object.setorigintoselected', 'C', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.knife_tool', 'S', 'PRESS')
kmi_props_setattr(kmi.properties, 'only_selected', True)
kmi = km.keymap_items.new('mesh.flip_normals', 'F5', 'PRESS')

# Map Object Non-modal
km = kc.keymaps.new('Object Non-modal', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'A', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.animation')
kmi = km.keymap_items.new('wm.call_menu_pie', 'TAB', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.objecteditmode')
kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'EDIT')
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'mode', 'POSE')
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi = km.keymap_items.new('object.mode_set', 'V', 'PRESS')
kmi_props_setattr(kmi.properties, 'mode', 'VERTEX_PAINT')
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'mode', 'WEIGHT_PAINT')
kmi_props_setattr(kmi.properties, 'toggle', True)
kmi.active = False
kmi = km.keymap_items.new('object.origin_set', 'C', 'PRESS', shift=True, ctrl=True, alt=True)

# Map UV Editor
km = kc.keymaps.new('UV Editor', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'W', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'pie.uvsweldalign')
kmi = km.keymap_items.new('wm.context_toggle', 'Q', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_uv_sculpt')
kmi = km.keymap_items.new('uv.mark_seam', 'E', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.select', 'SELECTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('uv.select', 'SELECTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('uv.select_loop', 'SELECTMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('uv.select_loop', 'SELECTMOUSE', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('uv.select_split', 'Y', 'PRESS')
kmi = km.keymap_items.new('uv.select_border', 'B', 'PRESS')
kmi_props_setattr(kmi.properties, 'pinned', False)
kmi = km.keymap_items.new('uv.select_border', 'B', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'pinned', True)
kmi = km.keymap_items.new('uv.circle_select', 'C', 'PRESS')
kmi = km.keymap_items.new('uv.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True)
kmi_props_setattr(kmi.properties, 'deselect', False)
kmi = km.keymap_items.new('uv.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'deselect', True)
kmi = km.keymap_items.new('uv.select_linked', 'L', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('uv.select_linked_pick', 'L', 'PRESS')
kmi_props_setattr(kmi.properties, 'extend', False)
kmi = km.keymap_items.new('uv.select_linked', 'L', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('uv.select_linked_pick', 'L', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'extend', True)
kmi = km.keymap_items.new('uv.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.select_all', 'A', 'PRESS')
kmi_props_setattr(kmi.properties, 'action', 'TOGGLE')
kmi = km.keymap_items.new('uv.select_all', 'I', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'action', 'INVERT')
kmi = km.keymap_items.new('uv.select_pinned', 'P', 'PRESS', shift=True)
kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS')
kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_weldalign')
kmi = km.keymap_items.new('uv.stitch', 'V', 'PRESS')
kmi = km.keymap_items.new('uv.pin', 'P', 'PRESS')
kmi_props_setattr(kmi.properties, 'clear', False)
kmi = km.keymap_items.new('uv.pin', 'P', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'clear', True)
kmi = km.keymap_items.new('uv.unwrap', 'E', 'PRESS')
kmi = km.keymap_items.new('uv.minimize_stretch', 'V', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.pack_islands', 'P', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.average_islands_scale', 'A', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('uv.hide', 'H', 'PRESS')
kmi_props_setattr(kmi.properties, 'unselected', False)
kmi = km.keymap_items.new('uv.hide', 'H', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'unselected', True)
kmi = km.keymap_items.new('uv.reveal', 'H', 'PRESS', alt=True)
kmi = km.keymap_items.new('uv.cursor_set', 'RIGHTMOUSE', 'PRESS', alt=True)
kmi = km.keymap_items.new('uv.tile_set', 'ACTIONMOUSE', 'PRESS', shift=True)
kmi = km.keymap_items.new('wm.call_menu', 'S', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_snap')
kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_select_mode')
kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff')
kmi_props_setattr(kmi.properties, 'wrap', True)
kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS')
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit')
kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED')
kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED')
kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS')
kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY')
kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS')
kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS')
kmi = km.keymap_items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_snap')
kmi = km.keymap_items.new('wm.context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.snap_uv_element')
kmi = km.keymap_items.new('uv.align', 'A', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'axis', 'ALIGN_AUTO')

# Map Text
km = kc.keymaps.new('Text', space_type='TEXT_EDITOR', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('wm.call_menu_pie', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'name', 'pie.texteditor')
kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELUPMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size')
kmi_props_setattr(kmi.properties, 'reverse', False)
kmi.active = False
kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size')
kmi_props_setattr(kmi.properties, 'reverse', True)
kmi.active = False
kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size')
kmi_props_setattr(kmi.properties, 'reverse', False)
kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size')
kmi_props_setattr(kmi.properties, 'reverse', True)
kmi = km.keymap_items.new('text.new', 'N', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.open', 'O', 'PRESS', alt=True)
kmi = km.keymap_items.new('text.reload', 'R', 'PRESS', alt=True)
kmi = km.keymap_items.new('text.save', 'S', 'PRESS', alt=True)
kmi = km.keymap_items.new('text.save_as', 'S', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('text.run_script', 'P', 'PRESS', alt=True)
kmi = km.keymap_items.new('text.cut', 'X', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.copy', 'C', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.paste', 'V', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.cut', 'DEL', 'PRESS', shift=True)
kmi = km.keymap_items.new('text.copy', 'INSERT', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.paste', 'INSERT', 'PRESS', shift=True)
kmi = km.keymap_items.new('text.duplicate_line', 'D', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.select_all', 'A', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.select_line', 'A', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('text.select_word', 'LEFTMOUSE', 'DOUBLE_CLICK')
kmi = km.keymap_items.new('text.move_lines', 'UP_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'direction', 'UP')
kmi = km.keymap_items.new('text.move_lines', 'DOWN_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'direction', 'DOWN')
kmi = km.keymap_items.new('text.indent', 'TAB', 'PRESS')
kmi = km.keymap_items.new('text.unindent', 'TAB', 'PRESS', shift=True)
kmi = km.keymap_items.new('text.uncomment', 'D', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('text.move', 'HOME', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN')
kmi = km.keymap_items.new('text.move', 'END', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'LINE_END')
kmi = km.keymap_items.new('text.move', 'E', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'LINE_END')
kmi = km.keymap_items.new('text.move', 'E', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'LINE_END')
kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER')
kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER')
kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD')
kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD')
kmi = km.keymap_items.new('text.move', 'UP_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE')
kmi = km.keymap_items.new('text.move', 'DOWN_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE')
kmi = km.keymap_items.new('text.move', 'PAGE_UP', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE')
kmi = km.keymap_items.new('text.move', 'PAGE_DOWN', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE')
kmi = km.keymap_items.new('text.move', 'HOME', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP')
kmi = km.keymap_items.new('text.move', 'END', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM')
kmi = km.keymap_items.new('text.move_select', 'HOME', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN')
kmi = km.keymap_items.new('text.move_select', 'END', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'LINE_END')
kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER')
kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER')
kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD')
kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD')
kmi = km.keymap_items.new('text.move_select', 'UP_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE')
kmi = km.keymap_items.new('text.move_select', 'DOWN_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE')
kmi = km.keymap_items.new('text.move_select', 'PAGE_UP', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE')
kmi = km.keymap_items.new('text.move_select', 'PAGE_DOWN', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE')
kmi = km.keymap_items.new('text.move_select', 'HOME', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP')
kmi = km.keymap_items.new('text.move_select', 'END', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM')
kmi = km.keymap_items.new('text.delete', 'DEL', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER')
kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS')
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER')
kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER')
kmi = km.keymap_items.new('text.delete', 'DEL', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD')
kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD')
kmi = km.keymap_items.new('text.overwrite_toggle', 'INSERT', 'PRESS')
kmi = km.keymap_items.new('text.scroll_bar', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('text.scroll_bar', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('text.scroll', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('text.scroll', 'TRACKPADPAN', 'ANY')
kmi = km.keymap_items.new('text.selection_set', 'EVT_TWEAK_L', 'ANY')
kmi = km.keymap_items.new('text.cursor_set', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('text.selection_set', 'LEFTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'select', True)
kmi = km.keymap_items.new('text.scroll', 'WHEELUPMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'lines', -1)
kmi = km.keymap_items.new('text.scroll', 'WHEELDOWNMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'lines', 1)
kmi = km.keymap_items.new('text.line_break', 'RET', 'PRESS')
kmi = km.keymap_items.new('text.line_break', 'NUMPAD_ENTER', 'PRESS')
kmi = km.keymap_items.new('wm.call_menu', 'RIGHTMOUSE', 'PRESS', any=True)
kmi_props_setattr(kmi.properties, 'name', 'TEXT_MT_toolbox')
kmi = km.keymap_items.new('text.autocomplete', 'SPACE', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('text.line_number', 'TEXTINPUT', 'ANY', any=True)
kmi = km.keymap_items.new('text.insert', 'TEXTINPUT', 'ANY', any=True)

