fixes test errors

Fixing imports and links

Fixes isort.

Updates my keymap
This commit is contained in:
Luke D Russell
2022-06-10 08:01:16 +10:00
committed by Kyle Brown
parent dde6efe6fe
commit 10572d71f6
6 changed files with 104 additions and 84 deletions

View File

@@ -1,18 +1,19 @@
# Faux Fox Keyboard (ffkb)
![ffkb](https://github.com/sadekbaroudi/ffkb)
![ffkb](https://fingerpunch.xyz/product/faux-fox-keyboard)
A 36 or 42 key keyboard with support for per key LEDs, 2 rotary encoders (EC11 or evqwgd001), and a feature in the center (EC11, OLED (128x64), or pimoroni trackball)
A 36 or 42 key keyboard with support for per key LEDs, 2 rotary encoders (EC11 or evqwgd001), and a feature in the center (EC11, OLED (128x64), or pimoroni trackball). KMK support is available for the BYO MCU option only.
kb.py is designed to work with a Pro Micro or KB2040, while kb-nn.py is designed to work with a Nice!Nano.
`kb-kb2040.py` is designed to work with a KB2040.
`kb-nn.py` is designed to work with a Nice!Nano.
- [Layers](https://github.com/KMKfw/kmk_firmware/tree/master/docs/layers.md) Need more keys than switches? Use layers.
- [RGB](https://github.com/KMKfw/kmk_firmware/tree/master/docs/rgb.md) Light it up
Instructions:
* Copy the kmk directory as a whole into the root directory of your KB2040
* Copy <gitroot>/lib/neopixel* to <usbroot>/lib/
* Copy kb.py and main.py in this folder to <usbroot>/
> Note: The Nice!Nano doesn't have a lot of ROM, see guidance [over here](../../docs/../../docs/Officially_Supported_Microcontrollers.md#nicenano).
* Copy the kmk directory as a whole into the root directory of your KB2040.
* Copy <gitroot>/lib/neopixel* to <usbroot>/lib/.
* Copy kb.py and main.py in this folder to <usbroot>/.
> Note: The Nice!Nano doesn't have a lot of ROM, so there are a couple of extra steps. See guidance [over here](../../docs/Officially_Supported_Microcontrollers.md#nicenano).

View File

@@ -1,38 +0,0 @@
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.D9,
board.D8,
board.D7,
board.D6,
board.D5,
board.D4,
board.MOSI,
board.MISO,
)
row_pins = (
board.D1,
board.A3,
board.A2,
board.A1,
board.A0,
board.SCK,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.D0
rgb_num_pixels = 42
i2c = board.I2C
coord_mapping = [
ic(0,0), ic(0,1), ic(0,2), ic(0,3), ic(0,4), ic(0,5), ic(0,6), ic(0,7), ic(4,3), ic(3,4), ic(4,5), ic(3,7),
ic(1,0), ic(1,1), ic(1,2), ic(1,3), ic(1,4), ic(1,5), ic(4,1), ic(1,6), ic(1,7), ic(3,2), ic(4,4), ic(3,5), ic(4,7),
ic(2,0), ic(2,1), ic(2,2), ic(2,3), ic(2,4), ic(2,5), ic(2,6), ic(2,7), ic(4,2), ic(3,3), ic(3,6), ic(4,6),
ic(5,1), ic(5,3), ic(5,4), ic(5,5), ic(5,6), ic(5,7), ic(5,2), ic(5,0)
]

View File

@@ -0,0 +1,37 @@
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.scanners import DiodeOrientation
from kmk.scanners import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.D9,
board.D8,
board.D7,
board.D6,
board.D5,
board.D4,
board.MOSI,
board.MISO,
)
row_pins = (
board.D1,
board.A3,
board.A2,
board.A1,
board.A0,
board.SCK,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.D0
rgb_num_pixels = 42
i2c = board.I2C
coord_mapping = [
ic(0, 0), ic(0, 1), ic(0, 2), ic(0, 3), ic(0, 4), ic(0, 5), ic(0, 6), ic(0, 7), ic(4, 3), ic(3, 4), ic(4, 5), ic(3, 7),
ic(1, 0), ic(1, 1), ic(1, 2), ic(1, 3), ic(1, 4), ic(1, 5), ic(4, 1), ic(1, 6), ic(1, 7), ic(3, 2), ic(4, 4), ic(3, 5), ic(4, 7),
ic(2, 0), ic(2, 1), ic(2, 2), ic(2, 3), ic(2, 4), ic(2, 5), ic(2, 6), ic(2, 7), ic(4, 2), ic(3, 3), ic(3, 6), ic(4, 6),
ic(5, 1), ic(5, 3), ic(5, 4), ic(5, 5), ic(5, 6), ic(5, 7), ic(5, 2), ic(5, 0)
]

View File

@@ -28,12 +28,12 @@ class KMKKeyboard(_KMKKeyboard):
rgb_num_pixels = 42
i2c = board.I2C
coord_mapping = [
0, 1, 2, 3, 4, 5, 6, 7,35,28,37,31,
8, 9,10,11,12,13, 33, 14,15,26,36,29,39,
16,17,18,19,20,21, 22,23,34,27,30,38,
41, 43,44,45, 46,47,42, 40,
]
0, 1, 2, 3, 4, 5, 6, 7, 35, 28, 37, 31,
8, 9, 10, 11, 12, 13, 33, 14, 15, 26, 36, 29, 39,
16, 17, 18, 19, 20, 21, 22, 23, 34, 27, 30, 38,
41, 43, 44, 45, 46, 47, 42, 40,
]
encoder_pins = ((board.P0_20, board.P0_17, board.P0_09, False))
encoder_pins = ((board.P0_20, board.P0_17, board.P0_09, False))

View File

@@ -1,12 +1,13 @@
import board
from kb import KMKKeyboard
from kb_kb2040 import KMKKeyboard
from kmk.extensions.media_keys import MediaKeys
from kmk.extensions.rgb import RGB
from kmk.keys import KC
from kmk.modules.encoder import EncoderHandler
from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.encoder import EncoderHandler
from kmk.extensions.media_keys import MediaKeys
from kmk.modules.mouse_keys import MouseKeys
keyboard = KMKKeyboard()
@@ -26,7 +27,7 @@ media_keys = MediaKeys()
encoder_handler = EncoderHandler()
keyboard.modules = [layers, modtap]#, encoder_handler]
keyboard.modules = [layers, modtap] #, encoder_handler]
keyboard.modules.append(MouseKeys())
keyboard.extensions = [rgb, media_keys]
@@ -55,13 +56,13 @@ RGUI_I = KC.MT(KC.I, KC.RGUI)
RCTL_O = KC.MT(KC.O, KC.RCTRL)
# OTHER SHORTCUTS
BRWSR_LFT = KC.LCTRL(KC.LSFT(KC.TAB))
BRWSR_LFT = KC.LCTRL(KC.LSFT(KC.TAB))
BRWSR_RGHT = KC.LCTRL(KC.TAB)
DESK_LEFT = KC.LCTRL(KC.LGUI(KC.LEFT))
DESK_LEFT = KC.LCTRL(KC.LGUI(KC.LEFT))
DESK_RIGHT = KC.LCTRL(KC.LGUI(KC.RIGHT))
CAPSWORD = _______ # TODO: IMPLEMENT THIS
CAPSWORD = _______ # TODO: IMPLEMENT THIS
#SHIFT NAV
# SHIFT NAV
SFT_PGUP = KC.LSFT(KC.PGUP)
SFT_PGDN = KC.LSFT(KC.PGDN)
SFT_HOME = KC.LSFT(KC.HOME)
@@ -126,13 +127,14 @@ keyboard.keymap = [
],
]
encoder_handler.map = [(( KC.VOLD, KC.VOLU, KC.MUTE)), # Layer 1
((ZOOM_OUT, ZOOM_IN, _______)), # Layer 2
((_______, _______, _______)), # Layer 3
((_______, _______, _______)), # Layer 4
((_______, _______, _______)), # Layer 5
((_______, _______, _______)), # Layer 6
]
encoder_handler.map = [
((KC.VOLD, KC.VOLU, KC.MUTE)), # Layer 1
((ZOOM_OUT, ZOOM_IN, _______)), # Layer 2
((_______, _______, _______)), # Layer 3
((_______, _______, _______)), # Layer 4
((_______, _______, _______)), # Layer 5
((_______, _______, _______)), # Layer 6
]
if __name__ == '__main__':
keyboard.go()