|
1 | 1 | <template> |
2 | 2 | <div> |
3 | 3 | <p class="py-4">1. install the debug code on the keyboard</p> |
4 | | - <button class="btn-primary btn" @click="flashCoordMapping"> |
| 4 | + <button class="btn-primary btn btn-sm" @click="flashCoordMapping"> |
5 | 5 | Flash CoordMap Finder to keyboard |
6 | 6 | </button> |
7 | 7 | <div> |
|
15 | 15 | <div class="flex gap-2 py-4"> |
16 | 16 | <button class="btn-primary btn" @click="addRow">new Row</button> |
17 | 17 | <button class="btn-primary btn" @click="addSpc">add Space</button> |
| 18 | + <button class="btn-primary btn" @click="rmLast">remove last</button> |
| 19 | + <button class="btn-primary btn" @click="clear">clear</button> |
18 | 20 | </div> |
19 | | - <p class="py-4"> |
| 21 | + <p class="mb-4"> |
20 | 22 | 3. Now press each key starting in the top left corner in the first row and moving to the right |
21 | 23 | when you reached the end press the last key once again to start with the next row |
22 | 24 | </p> |
|
32 | 34 | <div> |
33 | 35 | <pre class="my-2 rounded bg-base-300 p-4">{{ coordmapstring }}</pre> |
34 | 36 | </div> |
| 37 | + <div class="flex gap-2"> |
| 38 | + |
35 | 39 | <button class="btn-primary btn mt-2" @click="done"> |
36 | | - {{ initialSetup ? 'next' : 'save Coord Maping' }} |
| 40 | + {{ initialSetup ? 'next' : 'save Coord Maping & create keyboard layout' }} |
| 41 | + </button> |
| 42 | + <button class="btn-primary btn mt-2" @click="onlySave" v-if="!initialSetup"> |
| 43 | + only save Coord Maping |
37 | 44 | </button> |
| 45 | + </div> |
| 46 | + <p class="my-4">note if your key indexes changed you need to rebuild your layout or adjust the indexes on the layout editor, only saving the coord map is only advisable if you wanted to modify spacings but not the order of the keys</p> |
38 | 47 | </div> |
39 | 48 | </template> |
40 | 49 |
|
@@ -66,6 +75,9 @@ const done = () => { |
66 | 75 | keyboardStore.coordMap = keys.value |
67 | 76 | emits('next') |
68 | 77 | } |
| 78 | +const onlySave = () => { |
| 79 | + keyboardStore.coordMap = keys.value |
| 80 | +} |
69 | 81 | const flashCoordMapping = async () => { |
70 | 82 | keyboardStore.coordMapSetup = true |
71 | 83 | await window.api.saveConfiguration( |
@@ -118,6 +130,13 @@ const keyboardlayout = computed(() => { |
118 | 130 | console.log(realKeys) |
119 | 131 | return realKeys |
120 | 132 | }) |
| 133 | +
|
| 134 | +const rmLast = () => { |
| 135 | + coordmap.value = coordmap.value.split(' ').slice(0, -1).join(' '); |
| 136 | +} |
| 137 | +const clear = ()=>{ |
| 138 | + coordmap.value='' |
| 139 | +} |
121 | 140 | </script> |
122 | 141 |
|
123 | 142 | <style lang="scss" scoped></style> |
0 commit comments