Exemple #1
0
def generate_switch_cherry_mx(output_path):
    spacing = 19.05
    group = 'Switch_Keyboard_Cherry_MX'
    out_path = os.path.join(output_path, f'{group}.pretty')
    if not os.path.isdir(out_path):
        os.mkdir(out_path)
    keys = ['1u', '1.25u', '1.25u90', '1.5u', '1.5u90', '1.75u', '1.75u90',
            '2u', '2u90', '2.25u', '2.25u90', '2.5u', '2.5u90', '2.75u',
            '2.75u90', '3u', '3u90', '4u', '4.5u', '5.5u', '6u', '6uOffset',
            '6.25u', '6.5u', '7u', 'ISOEnter', 'ISOEnter90', 'ISOEnter180',
            'ISOEnter270']

    switches = []

    for switch_type in ['PCB', 'Plate']:
        switches.append(SwitchCherryMX(switch_type=switch_type, path3d=path3d))

        for key in keys:
            switches.append(SwitchCherryMX(switch_type=switch_type,
                                           path3d=path3d,
                                           keycap=Keycap(spacing=spacing,
                                                         **keycaps[key])))

    for switch in switches:
        file_handler = KicadFileHandler(switch)
        file_handler.writeFile(os.path.join(out_path, f'{switch.name}.kicad_mod'), timestamp=0)
Exemple #2
0
def generate_switch_hotswap_kailh_choc(output_path):
    x_spacing = 18
    y_spacing = 17
    group = 'Switch_Keyboard_Hotswap_Kailh'
    out_path = os.path.join(output_path, f'{group}.pretty')
    if not os.path.isdir(out_path):
        os.mkdir(out_path)
    keys = ['1u', '1.25u', '1.25u90', '1.5u', '1.5u90', '1.75u', '1.75u90',
            '2u', '2u90', '2.25u', '2.25u90', '2.5u', '2.5u90', '2.75u',
            '2.75u90', '3u', '3u90', '4u', '4.5u', '5.5u', '6u', '6uOffset',
            '6.25u', '6.5u', '7u', 'ISOEnter', 'ISOEnter90', 'ISOEnter180',
            'ISOEnter270']

    switches = []

    for plated in [False, True]:

        switches.append(SwitchKailhChoc(path3d=path3d, hotswap=True,
                                        hotswap_plated=plated))

        for key in keys:
            switches.append(SwitchKailhChoc(path3d=path3d, hotswap=True,
                                            hotswap_plated=plated,
                                            keycap=Keycap(x_spacing=x_spacing,
                                                          y_spacing=y_spacing,
                                                          **keycaps[key])))

    for switch in switches:
        file_handler = KicadFileHandler(switch)
        file_handler.writeFile(os.path.join(out_path, f'{switch.name}.kicad_mod'), timestamp=0)
Exemple #3
0
def generate_switch_alps_matias(output_path):
    spacing = 19.05
    group = 'Switch_Keyboard_Alps_Matias'
    out_path = os.path.join(output_path, f'{group}.pretty')
    if not os.path.isdir(out_path):
        os.mkdir(out_path)
    keys = ['1u', '1.25u', '1.5u', '1.75u', '2u', '2.25u', '2.5u', '2.75u',
            '3u', '4u', '4.5u', '5.5u', '6u', '6.25u', '6.5u', '7u',
            'ISOEnter']

    switches = []

    switches.append(SwitchAlpsMatias(path3d=path3d))

    for key in keys:
        switches.append(SwitchAlpsMatias(path3d=path3d,
                                         keycap=Keycap(spacing=spacing,
                                                       **keycaps[key])))

    for switch in switches:
        file_handler = KicadFileHandler(switch)
        file_handler.writeFile(os.path.join(out_path, f'{switch.name}.kicad_mod'), timestamp=0)