def _extend_short_names(name_to_vk_map, keep_orig=True):
    """
    Extend given `name to virtual key` map with short names.

    Rules for converting standard name to short name:
        VK_KEY_A -> A
        VK_HOME -> HOME
        KVK_ANSI_A -> A
        KVK_HOME -> HOME

    :param name_to_vk_map: Name to virtual key map.

    :param keep_orig: Whether keep original names.

    :return: New `name to virtual key` map with short names added.
    """
    # Result dict
    res_dict = {}

    # For given `name to virtual key` map's each item
    for name, vk in name_to_vk_map.items():
        # If need keep original names
        if keep_orig:
            # Add the original name to the result dict
            res_dict[name] = vk

        # Short name
        short_name = None

        # If the name starts with `VK_KEY_`
        if name.startswith('VK_KEY_'):
            # Strip prefix `VK_KEY_`, e.g. `VK_KEY_A` -> `A`
            short_name = name[7:]

        # If the name not starts with `VK_KEY_`.

        # If the name starts with `VK_`.
        elif name.startswith('VK_'):
            # Strip prefix `VK_`, e.g. `VK_HOME` -> `HOME`
            short_name = name[3:]

        # If the name starts with `KVK_ANSI_`
        elif name.startswith('KVK_ANSI_'):
            # Strip prefix `KVK_ANSI_`, e.g. `KVK_ANSI_A` -> `A`
            short_name = name[9:]

        # If the name not starts with `KVK_ANSI_`.

        # If the name starts with `KVK_`.
        elif name.startswith('KVK_'):
            # Strip prefix `KVK_`, e.g. `KVK_HOME` -> `HOME`
            short_name = name[4:]

        # If the name is none of above
        else:
            # Set short name be None
            short_name = None

        # If short name is found
        if short_name is not None:
            # Add the short name to the result dict
            res_dict[short_name] = vk

    # Return the result dict
    return res_dict