fix column flipping on rhs of split boards. (boards)

This commit is contained in:
xs5871 2022-02-20 20:28:52 +00:00 committed by Kyle Brown
parent ab7e0d3eb6
commit ef7b29bd43
8 changed files with 60 additions and 107 deletions

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -16,14 +15,10 @@ class KMKKeyboard(_KMKKeyboard):
powersave_pin = board.P0_13 powersave_pin = board.P0_13
# NOQA # NOQA
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 5) for x in range(5)) coord_mapping = [
coord_mapping.extend(ic(4, x, 5) for x in range(5)) 0, 1, 2, 3, 4, 20, 21, 22, 23, 24,
coord_mapping.extend(ic(1, x, 5) for x in range(5)) 5, 6, 7, 8, 9, 25, 26, 27, 28, 29,
coord_mapping.extend(ic(5, x, 5) for x in range(5)) 10, 11, 12, 13, 14, 30, 31, 32, 33, 34,
coord_mapping.extend(ic(2, x, 5) for x in range(5)) 17, 18, 19, 35, 36, 37,
coord_mapping.extend(ic(6, x, 5) for x in range(5)) ]
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x, 5) for x in range(2, 5))
coord_mapping.extend(ic(7, x, 5) for x in range(0, 3))

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -21,14 +20,11 @@ class KMKKeyboard(_KMKKeyboard):
i2c = board.I2C i2c = board.I2C
powersave_pin = board.P0_13 powersave_pin = board.P0_13
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 6) for x in range(6)) coord_mapping = [
coord_mapping.extend(ic(4, x, 6) for x in range(6)) 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24,
coord_mapping.extend(ic(1, x, 6) for x in range(6)) 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30,
coord_mapping.extend(ic(5, x, 6) for x in range(6)) 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36,
coord_mapping.extend(ic(2, x, 6) for x in range(6)) 21, 22, 23, 47, 46, 45,
coord_mapping.extend(ic(6, x, 6) for x in range(6)) ]
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x, 6) for x in range(3, 6))
coord_mapping.extend(ic(7, x, 6) for x in range(0, 3))

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -20,14 +19,10 @@ class KMKKeyboard(_KMKKeyboard):
rgb_pixel_pin = board.D0 rgb_pixel_pin = board.D0
i2c = board.I2C i2c = board.I2C
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 6) for x in range(6)) coord_mapping = [
coord_mapping.extend(ic(4, x, 6) for x in range(6)) 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24,
coord_mapping.extend(ic(1, x, 6) for x in range(6)) 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30,
coord_mapping.extend(ic(5, x, 6) for x in range(6)) 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36,
coord_mapping.extend(ic(2, x, 6) for x in range(6)) 21, 22, 23, 47, 46, 45,
coord_mapping.extend(ic(6, x, 6) for x in range(6)) ]
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x, 6) for x in range(3, 6))
coord_mapping.extend(ic(7, x, 6) for x in range(0, 3))

View File

@ -25,14 +25,10 @@ class KMKKeyboard(_KMKKeyboard):
powersave_pin = board.P0_13 powersave_pin = board.P0_13
# NOQA # NOQA
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 7) for x in range(7)) coord_mapping = [
coord_mapping.extend(ic(4, x, 7) for x in range(7)) 0, 1, 2, 3, 4, 5, 6, 34, 33, 32, 31, 30, 29, 28,
coord_mapping.extend(ic(1, x, 7) for x in range(7)) 7, 8, 9, 10, 11, 12, 13, 41, 40, 39, 38, 37, 36, 35,
coord_mapping.extend(ic(5, x, 7) for x in range(7)) 14, 15, 16, 17, 18, 19, 20, 48, 47, 46, 45, 44, 43, 42,
coord_mapping.extend(ic(2, x, 7) for x in range(7)) 21, 22, 23, 24, 25, 26, 54, 53, 52, 51, 50, 49,
coord_mapping.extend(ic(6, x, 7) for x in range(7)) ]
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x, 7) for x in range(0, 6))
coord_mapping.extend(ic(7, x, 7) for x in range(1, 7))

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -23,14 +22,6 @@ class KMKKeyboard(_KMKKeyboard):
data_pin = board.P0_20 data_pin = board.P0_20
powersave_pin = board.P0_13 powersave_pin = board.P0_13
coord_mapping = []
coord_mapping.extend(ic(0, x, 6) for x in range(6))
coord_mapping.extend(ic(4, x, 6) for x in range(6))
coord_mapping.extend(ic(1, x, 6) for x in range(6))
coord_mapping.extend(ic(5, x, 6) for x in range(6))
coord_mapping.extend(ic(2, x, 6) for x in range(6))
coord_mapping.extend(ic(6, x, 6) for x in range(6))
# Buckle up friends, the bottom row of this keyboard is wild, and making # Buckle up friends, the bottom row of this keyboard is wild, and making
# our layouts match, visually, what the keyboard looks like, requires some # our layouts match, visually, what the keyboard looks like, requires some
# surgery on the bottom two rows of coords # surgery on the bottom two rows of coords
@ -39,11 +30,11 @@ class KMKKeyboard(_KMKKeyboard):
# just like the above three rows, however, visually speaking, the # just like the above three rows, however, visually speaking, the
# top-right thumb cluster button (when looking at the left-half PCB) # top-right thumb cluster button (when looking at the left-half PCB)
# is more inline with R3, so we'll jam that key (and its mirror) in here # is more inline with R3, so we'll jam that key (and its mirror) in here
coord_mapping.extend(ic(3, x, 6) for x in range(6)) # flake8: noqa
coord_mapping.append(ic(4, 2, 6)) coord_mapping = [
coord_mapping.append(ic(8, 3, 6)) 0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31,
coord_mapping.extend(ic(7, x, 6) for x in range(6)) # Now, the rest of R3 6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37,
12, 13, 14, 15, 16, 17, 48, 47, 46, 45, 44, 43,
# And now, to handle R4, which at this point is down to just six keys 18, 19, 20, 21, 22, 23, 26, 57, 54, 53, 52, 51, 50, 49,
coord_mapping.extend(ic(4, x, 6) for x in range(3, 6)) 28, 29, 30, 60, 59, 58,
coord_mapping.extend(ic(8, x, 6) for x in range(0, 3)) ]

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -14,7 +13,7 @@ class KMKKeyboard(_KMKKeyboard):
diode_orientation = DiodeOrientation.COLUMNS diode_orientation = DiodeOrientation.COLUMNS
split_flip = True split_flip = True
split_offsets = (6, 6, 6, 6, 6) split_offset = (6, 6, 6, 6, 6)
split_type = 'UART' split_type = 'UART'
data_pin = board.SCL data_pin = board.SCL
data_pin2 = board.SDA data_pin2 = board.SDA
@ -23,14 +22,6 @@ class KMKKeyboard(_KMKKeyboard):
rgb_pixel_pin = board.TX rgb_pixel_pin = board.TX
led_pin = board.D7 led_pin = board.D7
coord_mapping = []
coord_mapping.extend(ic(0, x, 6) for x in range(6))
coord_mapping.extend(ic(4, x, 6) for x in range(6))
coord_mapping.extend(ic(1, x, 6) for x in range(6))
coord_mapping.extend(ic(5, x, 6) for x in range(6))
coord_mapping.extend(ic(2, x, 6) for x in range(6))
coord_mapping.extend(ic(6, x, 6) for x in range(6))
# Buckle up friends, the bottom row of this keyboard is wild, and making # Buckle up friends, the bottom row of this keyboard is wild, and making
# our layouts match, visually, what the keyboard looks like, requires some # our layouts match, visually, what the keyboard looks like, requires some
# surgery on the bottom two rows of coords # surgery on the bottom two rows of coords
@ -39,11 +30,11 @@ class KMKKeyboard(_KMKKeyboard):
# just like the above three rows, however, visually speaking, the # just like the above three rows, however, visually speaking, the
# top-right thumb cluster button (when looking at the left-half PCB) # top-right thumb cluster button (when looking at the left-half PCB)
# is more inline with R3, so we'll jam that key (and its mirror) in here # is more inline with R3, so we'll jam that key (and its mirror) in here
coord_mapping.extend(ic(3, x, 6) for x in range(6)) # flake8: noqa
coord_mapping.append(ic(4, 2, 6)) coord_mapping = [
coord_mapping.append(ic(8, 3, 6)) 0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31,
coord_mapping.extend(ic(7, x, 6) for x in range(6)) # Now, the rest of R3 6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37,
12, 13, 14, 15, 16, 17, 48, 47, 46, 45, 44, 43,
# And now, to handle R4, which at this point is down to just six keys 18, 19, 20, 21, 22, 23, 26, 57, 54, 53, 52, 51, 50, 49,
coord_mapping.extend(ic(4, x, 6) for x in range(3, 6)) 28, 29, 30, 60, 59, 58,
coord_mapping.extend(ic(8, x, 6) for x in range(0, 3)) ]

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -22,16 +21,11 @@ class KMKKeyboard(_KMKKeyboard):
i2c = board.I2C i2c = board.I2C
powersave_pin = board.P0_13 powersave_pin = board.P0_13
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 6) for x in range(6)) coord_mapping = [
coord_mapping.extend(ic(4, x, 6) for x in range(6)) 0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31,
coord_mapping.extend(ic(1, x, 6) for x in range(6)) 6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37,
coord_mapping.extend(ic(5, x, 6) for x in range(6)) 12, 13, 14, 15, 16, 17, 48, 47, 46, 45, 44, 43,
coord_mapping.extend(ic(2, x, 6) for x in range(6)) 18, 19, 20, 21, 22, 23, 54, 53, 52, 51, 50, 49,
coord_mapping.extend(ic(6, x, 6) for x in range(6)) 26, 27, 28, 29, 30, 60, 59, 58, 57, 56,
coord_mapping.extend(ic(3, x, 6) for x in range(6)) ]
coord_mapping.extend(ic(7, x, 6) for x in range(6))
# And now, to handle R4, which at this point is down to just ten keys
coord_mapping.extend(ic(4, x, 6) for x in range(1, 6))
coord_mapping.extend(ic(8, x, 6) for x in range(0, 5))

View File

@ -2,7 +2,6 @@ import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
@ -10,14 +9,10 @@ class KMKKeyboard(_KMKKeyboard):
col_pins = (board.GP21, board.GP20, board.GP19, board.GP18, board.GP17, board.GP16) col_pins = (board.GP21, board.GP20, board.GP19, board.GP18, board.GP17, board.GP16)
diode_orientation = DiodeOrientation.COLUMNS diode_orientation = DiodeOrientation.COLUMNS
coord_mapping = [] # flake8: noqa
coord_mapping.extend(ic(0, x, 6) for x in range(6)) coord_mapping = [
coord_mapping.extend(ic(4, x, 6) for x in range(6)) 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24,
coord_mapping.extend(ic(1, x, 6) for x in range(6)) 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30,
coord_mapping.extend(ic(5, x, 6) for x in range(6)) 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36,
coord_mapping.extend(ic(2, x, 6) for x in range(6)) 21, 22, 23, 47, 46, 45,
coord_mapping.extend(ic(6, x, 6) for x in range(6)) ]
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x, 6) for x in range(2, 6))
coord_mapping.extend(ic(7, x, 6) for x in range(0, 4))