コード例 #1
0
ファイル: KMK_KEYMAP.py プロジェクト: Envious-Data/Env-MCRO
import time

led = pwmio.PWMOut(board.GP25,
                   frequency=60,
                   duty_cycle=1024,
                   variable_frequency=True)

import board
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.matrix import DiodeOrientation
from kmk.modules.layers import Layers
from kmk.keys import KC, make_key
envkb = KMKKeyboard()

envkb.col_pins = (board.GP18, board.GP19, board.GP20, board.GP21)
envkb.row_pins = (board.GP4, board.GP11, board.GP15)
envkb.diode_orientation = DiodeOrientation.COLUMNS

rollover_cols_every_rows = 4
envkb.diode_orientation = DiodeOrientation.COLUMNS
envkb.debug_enabled = False

layers = Layers()
envkb.modules = [layers]

nokey = KC.NO
envkb.keymap = [
    [
        KC.F13,
        KC.F14,
コード例 #2
0
ファイル: code.py プロジェクト: Gordonby/Snippets
#PiPi-GHERKIN - Raspberry Pi PICO
import board
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.hid import HIDModes

gherkin = KMKKeyboard()

gherkin.col_pins = (board.GP2, board.GP3, board.GP4, board.GP5, board.GP6,
                    board.GP7)
gherkin.row_pins = (board.GP8, board.GP9, board.GP10, board.GP11, board.GP12)

#Rotate gherkin so USB on Right Side. Not needed if USB on Left Side.
gherkin.col_pins = tuple(reversed(gherkin.col_pins))
gherkin.row_pins = tuple(reversed(gherkin.row_pins))

gherkin.diode_orientation = DiodeOrientation.COLUMNS

gherkin.debug_enabled = False

gherkin.keymap = [
    [
        KC.Q,
        KC.W,
        KC.E,
        KC.R,
        KC.T,
        KC.Y,
        KC.U,
        KC.I,
コード例 #3
0
import board
import digitalio
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.extensions.media_keys import MediaKeys
from kmk.modules.rotaryEncoder import encoder

keyboard = KMKKeyboard()
keyboard.extensions.append(MediaKeys())
keyboard.col_pins = (board.GP15, board.GP13, board.GP12)
keyboard.row_pins = (board.GP8, board.GP9, board.GP10, board.GP11)
keyboard.diode_orientation = DiodeOrientation.COLUMNS
keyboard.debug_enabled = True

pins = [[board.GP0, board.GP1], [board.GP2, board.GP3]]
encMap = [[[KC.VOLU, KC.VOLD], [KC.K, KC.J]],
          [[KC.MEDIA_NEXT_TRACK, KC.MEDIA_PREV_TRACK], [KC.X, KC.Z]]]
keyboard.modules.append(encoder(pins, encMap))

keyboard.keymap = [[
    KC.AUDIO_MUTE, None, KC.MEDIA_PLAY_PAUSE, KC.F13, KC.F14, KC.C, KC.D, KC.E,
    KC.F, KC.G, KC.H, KC.I
], [KC.Y, None, KC.Z, KC.L, KC.R, KC.S, KC.T, KC.U, KC.V, KC.W, KC.X, KC.J]]

# Onboard Pico LED enable
led = digitalio.DigitalInOut(board.GP25)
led.direction = digitalio.Direction.OUTPUT
led.value = True

if __name__ == "__main__":
コード例 #4
0
ファイル: lab68.py プロジェクト: KMKfw/kmk_firmware
i2c = busio.I2C(scl=board.SCL, sda=board.SDA, frequency=100000)
mcp = MCP23017(i2c, address=0x20)
keyboard = KMKKeyboard()
layer_ext = Layers
keyboard.modules = [layer_ext]

_______ = KC.TRNS
XXXXXXX = KC.NO

FN = KC.MO(1)

keyboard.debug_enabled = True

keyboard.col_pins = (mcp.get_pin(8), mcp.get_pin(9), mcp.get_pin(10),
                     mcp.get_pin(11), mcp.get_pin(12), mcp.get_pin(13),
                     mcp.get_pin(14), mcp.get_pin(15), mcp.get_pin(4),
                     mcp.get_pin(5), mcp.get_pin(6), mcp.get_pin(7),
                     mcp.get_pin(3), mcp.get_pin(2), mcp.get_pin(1))
keyboard.row_pins = (board.D7, board.D6, board.D5, board.D3, board.D2)
keyboard.diode_orientation = DiodeOrientation.COLUMNS

keyboard.keymap = [
    # Qwerty
    # ,--------------------------------------------------------------------------------------------------------.
    # |   `  |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  |   -  |   =  | Bksp | Del  |
    # |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------|
    # | Tab  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  |   [  |   ]  |   \  | PgUp |
    # |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------|
    # | Esc  |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |   '  |      |Enter | PgDn |
    # |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------|
    # | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Shift |      |  Up  | Ins  |
コード例 #5
0
ファイル: KMK-KEYMAP_RGB.py プロジェクト: Envious-Data/Env-KB
#PiPi-GHERKIN - Raspberry Pi PICO
#Rpi pico keyboard keymap, I used the gherkin keymap as a example :)
print("Keyboard is starting")
import board
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.modules.layers import Layers
from kmk.matrix import DiodeOrientation
from kmk.hid import HIDModes

envkb = KMKKeyboard()
keyboard = envkb
envkb.col_pins = (board.GP2, board.GP3, board.GP4, board.GP5, board.GP6, board.GP7, board.GP8, board.GP9, board.GP10, board.GP11, board.GP12, board.GP13, board.GP14, board.GP15, board.GP19, board.GP18, board.GP17, board.GP16)
envkb.row_pins = (board.GP20, board.GP21, board.GP22, board.GP26, board.GP27, board.GP28)
envkb.diode_orientation = DiodeOrientation.COLUMNS
envkb.debug_enabled = False
nokey = KC.NO

layers = Layers()
envkb.modules = [layers]

from kmk.extensions.RGB import RGB
from kmk.extensions.rgb import AnimationModes
#rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=27)
#
rgb_ext = RGB(pixel_pin=board.GP0,
        num_pixels=88,
        val_limit=100,
        hue_default=0
        sat_default=255,
        rgb_order=(1, 0, 2),  # GRB WS2812
コード例 #6
0
ファイル: klanck.py プロジェクト: xiaoquanaa/kmk_firmware
import board

from kmk.consts import UnicodeMode
from kmk.handlers.sequences import compile_unicode_string_sequences, send_string
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.types import AttrDict

keyboard = KMKKeyboard()

keyboard.col_pins = (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
keyboard.row_pins = (board.D10, board.D11, board.D12, board.D13)
keyboard.diode_orientation = DiodeOrientation.COLUMNS


# ------------------User level config variables ---------------------------------------
keyboard.unicode_mode = UnicodeMode.LINUX
keyboard.tap_time = 350
keyboard.leader_timeout = 2000
keyboard.debug_enabled = False

emoticons = compile_unicode_string_sequences({
    # Emoticons, but fancier
    'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻',
    'CHEER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚',
    'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻',
    'WAT': r'⊙.☉',
    'FF': r'凸(゚Д゚#)',
    'F': r'( ̄^ ̄)凸',
    'MEH': r'╮( ̄_ ̄)╭',
コード例 #7
0
ファイル: gherkin.py プロジェクト: xiaoquanaa/kmk_firmware
PC6: A2
PD4: A3
PD0: A4

PB6: D2
PB2: TX
PB3: RX
PB1: MI
PF7: MO
PF6: SCK
PF5: A5

Mosfet on B5 to control backlight
'''

keyboard.col_pins = (board.A4, board.A2, board.A3, board.A1, board.A0,
                     board.SDA)
keyboard.row_pins = (board.D2, board.TX, board.RX, board.MISO, board.MOSI)

# Kyle is f*****g stupid
keyboard.col_pins = tuple(reversed(keyboard.col_pins))
keyboard.row_pins = tuple(reversed(keyboard.row_pins))

keyboard.diode_orientation = DiodeOrientation.COLUMNS

# ------------------User level config variables ---------------------------------------
keyboard.unicode_mode = UnicodeMode.LINUX
keyboard.tap_time = 350
keyboard.leader_timeout = 2000
keyboard.debug_enabled = False

emoticons = compile_unicode_string_sequences({
コード例 #8
0
import board
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.handlers.sequences import send_string
import digitalio

redox_l = KMKKeyboard()

#redox_l.debug_enabled = True
redox_l.col_pins = (board.GP2, board.GP3, board.GP4, board.GP5, board.GP6, board.GP7, board.GP8)
redox_l.row_pins = (board.GP16, board.GP17, board.GP18, board.GP19, board.GP20)
redox_l.diode_orientation = DiodeOrientation.COLUMNS

redox_l.split_type = "UART"
redox_l.uart_pin = (board.GP0, board.GP1) # Must include this to get pico uart to work. kmk_keyboard.py lines 172, 174 changed from ...x=pin, to x=pin[0 or 1]
redox_l.split_flip = True
redox_l.split_offsets = [7, 7, 7, 7, 7]

qt_strg = send_string("quit()")

redox_l.keymap = [
    # Qwerty
    #     ,------------------------------------------------.               ,------------------------------------------------. 
    #     |  esc |   1  |   2  |   3  |   4  |   5  |delete|               |delete|   6  |   7  |   8  |   9  |   0  |  fn  |
    #     |------+------+------+------+------+------+------|               |------+------+------+------+------+------+------|
    #     | tab  |   Q  |   W  |   E  |   R  |   T  |  esc |               | rclck|   Y  |   U  |   I  |   O  |   P  |bckspc|
    #     |------+------+------+------+------+-------------|               |------+------+------+------+------+-------------|
    #     | ctrl |   A  |   S  |   D  |   F  |   G  |  {[  |               | -_   |   H  |   J  |   K  |   L  |   :  |  \|  |
    #     |------+------+------+------+------+------|------|               |------+------+------+------+------+------|------|
    #     | Shift|   Z  |   X  |   C  |   V  |   B  |  }]  |               | +=   |   N  |   M  |  ,<  |  .>  |  ?/  |Shift |