Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![Python Version](https://img.shields.io/badge/Python-3.x-blue.svg)](PythonVersion)
[![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)

Keymapviz can convert keymap.c in [qmk_firmware](https://github.com/qmk/qmk_firmware) to ascii art or json file.
Keymapviz can convert keymap.c in [qmk_firmware](https://github.com/qmk/qmk_firmware)
and .ino files in [Kaleidoscope](https://github.com/keyboardio/Kaleidoscope) to ascii art or json file.

Following keyboards are supported.

Expand All @@ -28,6 +29,8 @@ Following keyboards are supported.
- [sofle](https://github.com/qmk/qmk_firmware/tree/master/keyboards/sofle)
- [sweet16](https://github.com/qmk/qmk_firmware/tree/master/keyboards/1upkeyboards/sweet16)
- [ferris](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris)
- [model01](https://github.com/keyboardio/Kaleidoscope/tree/master/examples/Devices/Keyboardio/Model01) (Model01 and Model100)
- [model01_qmk](https://github.com/qmk/qmk_firmware/tree/master/keyboards/keyboardio/model01)

## Install

Expand Down
6 changes: 5 additions & 1 deletion keymapviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import keymapviz.keyboards.dactyl_manuform6x6
import keymapviz.keyboards.id75
import keymapviz.keyboards.ferris
import keymapviz.keyboards.model01
import keymapviz.keyboards.model01_qmk


KEYBOARDS = {
Expand All @@ -52,6 +54,8 @@
'dactyl_manuform6x6': keymapviz.keyboards.dactyl_manuform6x6,
'id75': keymapviz.keyboards.id75,
'ferris': keymapviz.keyboards.ferris,
'model01': keymapviz.keyboards.model01,
'model01_qmk': keymapviz.keyboards.model01_qmk,
}


Expand Down Expand Up @@ -97,7 +101,7 @@ def __parse_ascii_art(self, aa):


def __legends(self, keymap):
return [self.legends.get(_, re.sub(r'^KC_', '', _)) for _ in keymap] + [''] * 100 # FIXME :_(
return [self.legends.get(_, re.sub(r'^(KC_|Key_)', '', _)) for _ in keymap] + [''] * 100 # FIXME :_(


def __json_format(self, json_, keymap):
Expand Down
32 changes: 32 additions & 0 deletions keymapviz/keyboards/model01/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-

keymap_keyword = '(?:KEYMAP_STACKED)'
layout_editor_json = {
'default': 'keyboards/model01/layout_editor/default.json',
}

ascii_art = {
'default': '''
/* ,------------------------------------------------. ,------------------------------------------------.
* |{00 }|{01 }|{02 }|{03 }|{04 }|{05 }|{06 }| |{32 }|{33 }|{34 }|{35 }|{36 }|{37 }|{38 }|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* |{07 }|{08 }|{09 }|{10 }|{11 }|{12 }| | | |{40 }|{41 }|{42 }|{43 }|{44 }|{45 }|
* |------+------+------+------+------+------|{13 }| |{39 }+------+------+------+------+------+------|
* |{14 }|{15 }|{16 }|{17 }|{18 }|{19 }|------| |------|{46 }|{47 }|{48 }|{49 }|{50 }|{51 }|
* |------+------+------+------+------+------| | | +------+------+------+------+------+------|
* |{20 }|{21 }|{22 }|{23 }|{24 }|{25 }|{26 }| |{52 }|{53 }|{54 }|{55 }|{56 }|{57 }|{58 }|
* `------+------+------+------+------+-------------' `------`------+------+------+------+------+------'
*
* ,-------------. ,-------------.
* |{27 }|{28 }|------. -------|{61 }|{62 }|
* | | |{29 }|------. ,------|{60 }| | |
* `-------------| |{30 }| |{59 }| |-------------'
* `------| | | |------'
* ,------. `------' `------' ,------.
* | | | |
* |{31 }| |{63 }|
* | | | |
* `------' `------'
* generated by [keymapviz] */
''',
}
Loading