Changed LAYOUT_102key_ansi matrix definition (1) Reuse LAYOUT_all for the 102-key...
[jackhill/qmk/firmware.git] / keyboards / xwhatsit / ibm / f107 / universal / universal.h
1 /* Copyright 2020 Purdea Andrei
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 #pragma once
18
19 #include "quantum.h"
20
21 /* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29
30 #define LAYOUT_102key_ansi( \
31 k_3_1, k_3_2, k_2_3, k_1_3, k_1_4, k_2_5, k_1_5, k_2_6, k_1_6, k_2_7, k_1_7, k_2_8, k_1_8, k_2_9, k_1_9, k_1_10, k_1_11, k_2_12, k_1_12, k_1_13, k_1_14, k_2_15, k_1_15, \
32 k_4_1, k_4_2, k_3_3, k_2_4, k_3_4, k_4_5, k_3_5, k_4_6, k_3_6, k_4_7, k_3_7, k_4_8, k_3_8, k_3_9, k_3_10, k_4_10, k_3_11, k_4_12, k_3_12, k_3_13, k_3_14, k_2_14, k_3_15, \
33 k_5_1, k_5_2, k_4_3, k_4_4, k_5_4, k_6_5, k_5_5, k_6_6, k_5_6, k_5_7, k_6_7, k_6_8, k_5_8, k_5_9, k_5_10, k_5_11, k_4_11, k_5_12, k_5_13, k_4_14, k_5_14, \
34 k_6_1, k_6_2, k_5_3, k_7_4, k_6_4, k_7_5, k_8_5, k_7_6, k_7_7, k_8_7, k_8_8, k_7_8, k_6_9, k_7_10, k_6_11, k_6_12, k_7_12, k_7_13, k_6_13, k_6_14, k_7_15, \
35 k_7_1, k_7_2, k_8_3, k_7_3, k_8_4, k_8_6, k_8_9, k_7_9, k_8_10, k_8_11, k_7_11, k_8_12, k_8_14, k_7_14 \
36 ) \
37 LAYOUT_all( \
38 k_3_1, k_3_2, k_2_3, k_1_3, k_1_4, k_2_5, k_1_5, k_2_6, k_1_6, k_2_7, k_1_7, k_2_8, k_1_8, k_2_9, k_1_9, KC_NO, k_1_10, k_1_11, k_2_12, k_1_12, k_1_13, k_1_14, k_2_15, k_1_15, \
39 k_4_1, k_4_2, k_3_3, k_2_4, k_3_4, k_4_5, k_3_5, k_4_6, k_3_6, k_4_7, k_3_7, k_4_8, k_3_8, k_3_9, k_3_10, k_4_10, k_3_11, k_4_12, k_3_12, k_3_13, k_3_14, k_2_14, k_3_15, \
40 k_5_1, k_5_2, k_4_3, k_4_4, k_5_4, k_6_5, k_5_5, k_6_6, k_5_6, k_5_7, k_6_7, k_6_8, k_5_8, k_5_9, KC_NO, k_5_10, k_5_11, k_4_11, k_5_12, k_5_13, k_4_14, k_5_14, KC_NO, \
41 k_6_1, k_6_2, k_5_3, KC_NO, k_7_4, k_6_4, k_7_5, k_8_5, k_7_6, k_7_7, k_8_7, k_8_8, k_7_8, k_6_9, KC_NO, k_7_10, k_6_11, k_6_12, k_7_12, k_7_13, k_6_13, k_6_14, k_7_15, \
42 k_7_1, k_7_2, k_8_3, k_7_3, k_8_4, k_8_6, k_8_9, k_7_9, k_8_10, k_8_11, k_7_11, k_8_12, KC_NO, k_8_14, k_7_14, KC_NO \
43 )
44
45 // Note:
46 // There are a couple of hidden pads, not mentioned in LAYOUT_102key_ansi() or LAYOUT_107key():
47 // There is one next to the left shift, on row 6. (columns in probably 3)
48 // There is one to the left of the backspace key, on row 2 (column is probably 10 (or 11? but less likely))
49 // There is one to the left of the enter key, on row 4 (column is probably 9)
50 // There is one to the left of right-shift key, row 6 (column is probably 10)
51 // There is one under the + key, on row 5 (column is probably 15)
52 // There is one under the kp enter key, on row 8 (column is probably 15)
53 // There is one to the right of the kp 0 key, on row 8 (column is probably 14)
54
55 // assuming the above notes are true:
56 #define LAYOUT_all( \
57 k_3_1, k_3_2, k_2_3, k_1_3, k_1_4, k_2_5, k_1_5, k_2_6, k_1_6, k_2_7, k_1_7, k_2_8, k_1_8, k_2_9, k_1_9, k_2_10, k_1_10, k_1_11, k_2_12, k_1_12, k_1_13, k_1_14, k_2_15, k_1_15, \
58 k_4_1, k_4_2, k_3_3, k_2_4, k_3_4, k_4_5, k_3_5, k_4_6, k_3_6, k_4_7, k_3_7, k_4_8, k_3_8, k_3_9, k_3_10, k_4_10, k_3_11, k_4_12, k_3_12, k_3_13, k_3_14, k_2_14, k_3_15, \
59 k_5_1, k_5_2, k_4_3, k_4_4, k_5_4, k_6_5, k_5_5, k_6_6, k_5_6, k_5_7, k_6_7, k_6_8, k_5_8, k_5_9, k_4_9, k_5_10, k_5_11, k_4_11, k_5_12, k_5_13, k_4_14, k_5_14, k_5_15, \
60 k_6_1, k_6_2, k_5_3, k_6_3, k_7_4, k_6_4, k_7_5, k_8_5, k_7_6, k_7_7, k_8_7, k_8_8, k_7_8, k_6_9, k_6_10, k_7_10, k_6_11, k_6_12, k_7_12, k_7_13, k_6_13, k_6_14, k_7_15, \
61 k_7_1, k_7_2, k_8_3, k_7_3, k_8_4, k_8_6, k_8_9, k_7_9, k_8_10, k_8_11, k_7_11, k_8_12, k_8_13, k_8_14, k_7_14, k_8_15 \
62 ) \
63 { \
64 { KC_NO, KC_NO, k_1_3, k_1_4, k_1_5, k_1_6, k_1_7, k_1_8, k_1_9, k_1_10, k_1_11, k_1_12, k_1_13, k_1_14, k_1_15}, \
65 { KC_NO, KC_NO, k_2_3, k_2_4, k_2_5, k_2_6, k_2_7, k_2_8, k_2_9, k_2_10, KC_NO, k_2_12, KC_NO, k_2_14, k_2_15}, \
66 { k_3_1, k_3_2, k_3_3, k_3_4, k_3_5, k_3_6, k_3_7, k_3_8, k_3_9, k_3_10, k_3_11, k_3_12, k_3_13, k_3_14, k_3_15}, \
67 { k_4_1, k_4_2, k_4_3, k_4_4, k_4_5, k_4_6, k_4_7, k_4_8, k_4_9, k_4_10, k_4_11, k_4_12, KC_NO, k_4_14, KC_NO}, \
68 { k_5_1, k_5_2, k_5_3, k_5_4, k_5_5, k_5_6, k_5_7, k_5_8, k_5_9, k_5_10, k_5_11, k_5_12, k_5_13, k_5_14, k_5_15}, \
69 { k_6_1, k_6_2, k_6_3, k_6_4, k_6_5, k_6_6, k_6_7, k_6_8, k_6_9, k_6_10, k_6_11, k_6_12, k_6_13, k_6_14, KC_NO}, \
70 { k_7_1, k_7_2, k_7_3, k_7_4, k_7_5, k_7_6, k_7_7, k_7_8, k_7_9, k_7_10, k_7_11, k_7_12, k_7_13, k_7_14, k_7_15}, \
71 { KC_NO, KC_NO, k_8_3, k_8_4, k_8_5, k_8_6, k_8_7, k_8_8, k_8_9, k_8_10, k_8_11, k_8_12, k_8_13, k_8_14, k_8_15} \
72 }
73
74 // layout 107key, is in the configuration shown by kishy.ca, the difference from _all, is that the backspace, and right shift are not split.
75 #define LAYOUT_107key( \
76 k_3_1, k_3_2, k_2_3, k_1_3, k_1_4, k_2_5, k_1_5, k_2_6, k_1_6, k_2_7, k_1_7, k_2_8, k_1_8, k_2_9, k_1_9, k_1_10, k_1_11, k_2_12, k_1_12, k_1_13, k_1_14, k_2_15, k_1_15, \
77 k_4_1, k_4_2, k_3_3, k_2_4, k_3_4, k_4_5, k_3_5, k_4_6, k_3_6, k_4_7, k_3_7, k_4_8, k_3_8, k_3_9, k_3_10, k_4_10, k_3_11, k_4_12, k_3_12, k_3_13, k_3_14, k_2_14, k_3_15, \
78 k_5_1, k_5_2, k_4_3, k_4_4, k_5_4, k_6_5, k_5_5, k_6_6, k_5_6, k_5_7, k_6_7, k_6_8, k_5_8, k_5_9, k_4_9, k_5_10, k_5_11, k_4_11, k_5_12, k_5_13, k_4_14, k_5_14, k_5_15, \
79 k_6_1, k_6_2, k_5_3, k_6_3, k_7_4, k_6_4, k_7_5, k_8_5, k_7_6, k_7_7, k_8_7, k_8_8, k_7_8, k_6_9, k_7_10, k_6_11, k_6_12, k_7_12, k_7_13, k_6_13, k_6_14, k_7_15, \
80 k_7_1, k_7_2, k_8_3, k_7_3, k_8_4, k_8_6, k_8_9, k_7_9, k_8_10, k_8_11, k_7_11, k_8_12, k_8_13, k_8_14, k_7_14, k_8_15 \
81 ) \
82 LAYOUT_all( \
83 k_3_1, k_3_2, k_2_3, k_1_3, k_1_4, k_2_5, k_1_5, k_2_6, k_1_6, k_2_7, k_1_7, k_2_8, k_1_8, k_2_9, k_1_9, KC_NO, k_1_10, k_1_11, k_2_12, k_1_12, k_1_13, k_1_14, k_2_15, k_1_15, \
84 k_4_1, k_4_2, k_3_3, k_2_4, k_3_4, k_4_5, k_3_5, k_4_6, k_3_6, k_4_7, k_3_7, k_4_8, k_3_8, k_3_9, k_3_10, k_4_10, k_3_11, k_4_12, k_3_12, k_3_13, k_3_14, k_2_14, k_3_15, \
85 k_5_1, k_5_2, k_4_3, k_4_4, k_5_4, k_6_5, k_5_5, k_6_6, k_5_6, k_5_7, k_6_7, k_6_8, k_5_8, k_5_9, k_4_9, k_5_10, k_5_11, k_4_11, k_5_12, k_5_13, k_4_14, k_5_14, k_5_15, \
86 k_6_1, k_6_2, k_5_3, k_6_3, k_7_4, k_6_4, k_7_5, k_8_5, k_7_6, k_7_7, k_8_7, k_8_8, k_7_8, k_6_9, KC_NO , k_7_10, k_6_11, k_6_12, k_7_12, k_7_13, k_6_13, k_6_14, k_7_15, \
87 k_7_1, k_7_2, k_8_3, k_7_3, k_8_4, k_8_6, k_8_9, k_7_9, k_8_10, k_8_11, k_7_11, k_8_12, k_8_13, k_8_14, k_7_14, k_8_15 \
88 )