This commit is contained in:
@@ -93,14 +93,15 @@
|
|||||||
|
|
||||||
BackSpace 0 0 8
|
BackSpace 0 0 8
|
||||||
Return 0 1 8
|
Return 0 1 8
|
||||||
Right 0 2 8
|
#Right 0 2 8
|
||||||
|
Right 6 3 8
|
||||||
F7 0 3 8
|
F7 0 3 8
|
||||||
F1 0 4 8
|
F1 0 4 8
|
||||||
F3 0 5 8
|
F3 0 5 8
|
||||||
F5 0 6 8
|
F5 0 6 8
|
||||||
F6 0 6 1
|
F6 0 6 1
|
||||||
Down 0 7 8
|
Down 0 7 8
|
||||||
|
#Down 5 0 0
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L |
|
# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L |
|
||||||
@@ -123,7 +124,7 @@ Shift_L 1 7 2
|
|||||||
#####################
|
#####################
|
||||||
# |Bit 5| + | P | L | - | . > | : [ | @ | , < |
|
# |Bit 5| + | P | L | - | . > | : [ | @ | , < |
|
||||||
|
|
||||||
Dash 5 0 8
|
#Dash 5 0 8
|
||||||
Equals 5 3 8
|
Equals 5 3 8
|
||||||
Period 5 4 8
|
Period 5 4 8
|
||||||
SemiColon 5 5 8
|
SemiColon 5 5 8
|
||||||
@@ -137,7 +138,7 @@ Comma 5 7 8
|
|||||||
Insert 6 0 8
|
Insert 6 0 8
|
||||||
RightBracket 6 1 8
|
RightBracket 6 1 8
|
||||||
SingleQuote 6 2 8
|
SingleQuote 6 2 8
|
||||||
Home 6 3 8
|
#Home 6 3 8
|
||||||
Shift_R 6 4 4
|
Shift_R 6 4 4
|
||||||
BackSlash 6 5 8
|
BackSlash 6 5 8
|
||||||
Del 6 6 8
|
Del 6 6 8
|
||||||
|
|||||||
@@ -0,0 +1,239 @@
|
|||||||
|
# Bare Metal Commodore keyboard mapping file suitable for real C64 keyboards using Keymmodore-64 interfase by K-rnivoro. https://github.com/K-rnivoro/Keymmodore-64
|
||||||
|
# Tested with BMC v3.9 (https://accentual.com/bmc64/)
|
||||||
|
# Mapped for positional compatibility with 264 Computers Series: Plus/4, Commodore-16 and Commodore-116 Keyboards.
|
||||||
|
# Based on C64 Positional Layout, however some keys change position in order to be easier to use and remember.
|
||||||
|
# The relevant changes are:
|
||||||
|
# ESCAPE is mapped to Left-Arrow Key.
|
||||||
|
# Cursor-Up is mapped to C64 Up-Arrow Key (C16/Plus-4 Up-Arrow is actually Shift+0).
|
||||||
|
# Cursor-Left is mapped to C64 RESTORE Key (C16/Plus-4 CLEAR/HOME Key moves to C64 CLEAR/HOME key).
|
||||||
|
# Cursor-Down is mapped to C64 Up/Down Cursor Key (It works only Down regardless Shift pressed or not, like the real C16/Plus-4 Key).
|
||||||
|
# Cursor-Right is mapped to C64 Left/Right Cursor Key (It works only Right regardless Shift pressed or not, like the real C16/Plus-4 Key).
|
||||||
|
#
|
||||||
|
# File format:
|
||||||
|
# - comment lines start with '#'
|
||||||
|
# - keyword lines start with '!keyword'
|
||||||
|
# - normal line has 'keysym/scancode row column shiftflag'
|
||||||
|
#
|
||||||
|
# Keywords and their lines are:
|
||||||
|
# '!CLEAR' clear whole table
|
||||||
|
# '!INCLUDE filename' read file as mapping file
|
||||||
|
# '!LSHIFT row col' left shift keyboard row/column
|
||||||
|
# '!RSHIFT row col' right shift keyboard row/column
|
||||||
|
# '!VSHIFT shiftkey' virtual shift key (RSHIFT or LSHIFT)
|
||||||
|
# '!UNDEF keysym' remove keysym from table
|
||||||
|
#
|
||||||
|
# Shiftflag can have the values:
|
||||||
|
# 0 key is not shifted for this keysym/scancode
|
||||||
|
# 1 key is shifted for this keysym/scancode
|
||||||
|
# 2 left shift
|
||||||
|
# 4 right shift
|
||||||
|
# 8 key can be shifted or not with this keysym/scancode
|
||||||
|
# 16 deshift key for this keysym/scancode
|
||||||
|
# 32 another definition for this keysym/scancode follows
|
||||||
|
#
|
||||||
|
# Negative row values:
|
||||||
|
# 'keysym -1 n' joystick #1, direction n
|
||||||
|
# 'keysym -2 n' joystick #2, direction n
|
||||||
|
# 'keysym -3 0' first RESTORE key
|
||||||
|
# 'keysym -3 1' second RESTORE key
|
||||||
|
# 'keysym -4 0' 40/80 column key
|
||||||
|
# 'keysym -4 1' CAPS (ASCII/DIN) key
|
||||||
|
#
|
||||||
|
# Joystick direction values:
|
||||||
|
# 0 Fire
|
||||||
|
# 1 South/West
|
||||||
|
# 2 South
|
||||||
|
# 3 South/East
|
||||||
|
# 4 West
|
||||||
|
# 5 East
|
||||||
|
# 6 North/West
|
||||||
|
# 7 North
|
||||||
|
# 8 North/East
|
||||||
|
#
|
||||||
|
# Joyport keypad key layout:
|
||||||
|
# --------------------------
|
||||||
|
# | 0 | 1 | 2 | 3 | 4 |
|
||||||
|
# --------------------------
|
||||||
|
# | 5 | 6 | 7 | 8 | 9 |
|
||||||
|
# --------------------------
|
||||||
|
# | 10 | 11 | 12 | 13 | 14 |
|
||||||
|
# --------------------------
|
||||||
|
# | 15 | 16 | 17 | 18 | 19 |
|
||||||
|
# --------------------------
|
||||||
|
#
|
||||||
|
# When a bigger spaced key is used,
|
||||||
|
# it uses the upper left most key value.
|
||||||
|
#
|
||||||
|
#############################################################################
|
||||||
|
#
|
||||||
|
# Commodore 16/116/Plus-4 keyboard matrix:
|
||||||
|
#
|
||||||
|
# 0 1 2 3 4 5 6 7
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 0 |INST-DEL|RETURN |POUND |HELP-F7 |F1-F4 |F2-F5 |F3-F6 |@ |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 1 |3 # |W |A |4 $ |Z |S |E |SHIFT |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 2 |5 % |R |D |6 & |C |F |T |X |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 3 |7 ' |Y |G |8 ( |B |H |U |V |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 4 |9 ) |I |J |0 ^ |M |K |O |N |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
# 7 |1 ! |CLR-HOME|CTRL |2 " |SPACE |C= |Q |RUN-STOP|
|
||||||
|
# +--------+--------+--------+--------+--------+--------+--------+--------+
|
||||||
|
#
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
!CLEAR
|
||||||
|
!LSHIFT 1 7
|
||||||
|
!RSHIFT 1 7
|
||||||
|
!VSHIFT RSHIFT
|
||||||
|
|
||||||
|
|
||||||
|
# Home = HOME
|
||||||
|
Home 7 1 8
|
||||||
|
|
||||||
|
# Enter = RETURN
|
||||||
|
Return 0 1 8
|
||||||
|
|
||||||
|
# Shifts = Shifts
|
||||||
|
Shift_L 1 7 2
|
||||||
|
Shift_R 1 7 4
|
||||||
|
|
||||||
|
# Space bar = Space
|
||||||
|
Space 7 4 8
|
||||||
|
|
||||||
|
|
||||||
|
# Tab = CTRL
|
||||||
|
Tab 7 2 8
|
||||||
|
|
||||||
|
# Control_L = CBM
|
||||||
|
Control_L 7 5 8
|
||||||
|
|
||||||
|
#Backspace = INST/DEL
|
||||||
|
BackSpace 0 0 8
|
||||||
|
|
||||||
|
# Delete = Cursor Up = C64 Arrow Up Key
|
||||||
|
Del 5 3 8
|
||||||
|
|
||||||
|
# Down = Cursor Down
|
||||||
|
Down 5 0 8
|
||||||
|
|
||||||
|
# Page Up = Cursor Left = C64 RESTORE Key
|
||||||
|
PageUp 6 0 8
|
||||||
|
|
||||||
|
# Right = Cursor Right
|
||||||
|
Right 6 3 8
|
||||||
|
|
||||||
|
# ESCAPE = RUN/STOP
|
||||||
|
Escape 7 7 8
|
||||||
|
|
||||||
|
# Grave = ESCAPE = C64 Arrow_Left Key
|
||||||
|
BackQuote 6 4 8
|
||||||
|
|
||||||
|
# Insert = Pound
|
||||||
|
Insert 0 2 8
|
||||||
|
|
||||||
|
# Minus = Plus
|
||||||
|
Dash 6 6 8
|
||||||
|
|
||||||
|
# Equal = Minus
|
||||||
|
Equals 5 6 8
|
||||||
|
|
||||||
|
# Bracket Left = At
|
||||||
|
LeftBracket 0 7 8
|
||||||
|
|
||||||
|
#Bracket Right = Asterisk
|
||||||
|
RightBracket 6 1 8
|
||||||
|
|
||||||
|
# Slash = Slash
|
||||||
|
Slash 6 7 8
|
||||||
|
|
||||||
|
# Backslash = Equal
|
||||||
|
BackSlash 6 5 8
|
||||||
|
|
||||||
|
# Single Quote = Semicolon
|
||||||
|
SingleQuote 6 2 8
|
||||||
|
|
||||||
|
# SemiColon = Colon
|
||||||
|
SemiColon 5 5 8
|
||||||
|
|
||||||
|
# Comma = Comma
|
||||||
|
Comma 5 7 8
|
||||||
|
|
||||||
|
# Period = Period
|
||||||
|
Period 5 4 8
|
||||||
|
|
||||||
|
### F Keys
|
||||||
|
F1 0 4 8
|
||||||
|
F3 0 5 8
|
||||||
|
F5 0 6 8
|
||||||
|
F7 0 3 8
|
||||||
|
|
||||||
|
|
||||||
|
### Numbers
|
||||||
|
0 4 3 8
|
||||||
|
1 7 0 8
|
||||||
|
2 7 3 8
|
||||||
|
3 1 0 8
|
||||||
|
4 1 3 8
|
||||||
|
5 2 0 8
|
||||||
|
6 2 3 8
|
||||||
|
7 3 0 8
|
||||||
|
8 3 3 8
|
||||||
|
9 4 0 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Letters
|
||||||
|
a 1 2 8
|
||||||
|
b 3 4 8
|
||||||
|
c 2 4 8
|
||||||
|
d 2 2 8
|
||||||
|
e 1 6 8
|
||||||
|
f 2 5 8
|
||||||
|
g 3 2 8
|
||||||
|
h 3 5 8
|
||||||
|
i 4 1 8
|
||||||
|
j 4 2 8
|
||||||
|
k 4 5 8
|
||||||
|
l 5 2 8
|
||||||
|
m 4 4 8
|
||||||
|
n 4 7 8
|
||||||
|
o 4 6 8
|
||||||
|
p 5 1 8
|
||||||
|
q 7 6 8
|
||||||
|
r 2 1 8
|
||||||
|
s 1 5 8
|
||||||
|
t 2 6 8
|
||||||
|
u 3 6 8
|
||||||
|
v 3 7 8
|
||||||
|
w 1 1 8
|
||||||
|
x 2 7 8
|
||||||
|
y 3 1 8
|
||||||
|
z 1 4 8
|
||||||
|
|
||||||
|
|
||||||
|
# joystick keymap A (port 1)
|
||||||
|
KP_8 -1 7 /* NumPad 8 -> UP */
|
||||||
|
KP_2 -1 2 /* NumPad 2 -> DOWN */
|
||||||
|
KP_4 -1 4 /* NumPad 4 -> LEFT */
|
||||||
|
KP_6 -1 5 /* NumPad 6 -> RIGHT */
|
||||||
|
KP_0 -1 0 /* NumPad 0 -> FIRE */
|
||||||
|
|
||||||
|
# joystick Keymap B (port 2)
|
||||||
|
KP_7 -2 7 /* NumPad 7 -> UP */
|
||||||
|
KP_3 -2 2 /* NumPad 3 -> DOWN */
|
||||||
|
KP_1 -2 4 /* NumPad 1 -> LEFT */
|
||||||
|
KP_9 -2 5 /* NumPad 9 -> RIGHT */
|
||||||
|
KP_Decimal -2 0 /* NumPad . -> FIRE */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Copyright 2013 Jun Wako <wakojun@gmail.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
include ../../Makefile
|
||||||
|
endif
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2023 K-rnivoro
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define LAYER_STATE_16BIT
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#undef LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* Define Mod-Tap behavior */
|
||||||
|
#define HOLD_ON_OTHER_KEY_PRESS
|
||||||
|
|
||||||
|
|
||||||
|
// Joystick Configuration
|
||||||
|
// Min 0, max 32
|
||||||
|
// #define JOYSTICK_BUTTON_COUNT 4
|
||||||
|
// Min 0, max 6: X, Y, Z, Rx, Ry, Rz
|
||||||
|
// #define JOYSTICK_AXIS_COUNT 4
|
||||||
|
// Min 8, max 16
|
||||||
|
// #define JOYSTICK_AXIS_RESOLUTION 8
|
||||||
|
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
{
|
||||||
|
"manufacturer": "Mauricio Franco",
|
||||||
|
"keyboard_name": "Keymmodore-64",
|
||||||
|
"maintainer": "K-rnivoro",
|
||||||
|
"processor": "RP2040",
|
||||||
|
"bootloader": "rp2040",
|
||||||
|
"diode_direction": "COL2ROW",
|
||||||
|
"features": {
|
||||||
|
"bootmagic": false,
|
||||||
|
"command": false,
|
||||||
|
"console": false,
|
||||||
|
"extrakey": true,
|
||||||
|
"mousekey": false,
|
||||||
|
"nkro": false,
|
||||||
|
"backlight": false,
|
||||||
|
"lto": true,
|
||||||
|
"rgblight": false,
|
||||||
|
"audio": false,
|
||||||
|
"space_cadet": false,
|
||||||
|
"magic": false
|
||||||
|
},
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["GP9", "GP8", "GP7", "GP6", "GP5", "GP4", "GP3", "GP2", "GP1"],
|
||||||
|
"rows": ["GP16", "GP17", "GP15", "GP14", "GP13", "GP12", "GP11", "GP10", "GP0"]
|
||||||
|
},
|
||||||
|
"url": "www.keymmodore.com",
|
||||||
|
"usb": {
|
||||||
|
"device_version": "1.0.0",
|
||||||
|
"pid": "0x0000",
|
||||||
|
"vid": "0xFEED"
|
||||||
|
},
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"1", "x":1.25, "y":0},
|
||||||
|
{"label":"Left_Arrow", "x":0.25, "y":0},
|
||||||
|
{"label":"CTRL", "x":0.25, "y":1, "w":1.5},
|
||||||
|
{"label":"RUN STOP", "x":0, "y":2},
|
||||||
|
{"label":"SPACE", "x":2.75, "y":4, "w":9}
|
||||||
|
{"label":"C=", "x":0, "y":3},
|
||||||
|
{"label":"Q", "x":1.75, "y":1},
|
||||||
|
{"label":"2", "x":2.25, "y":0},
|
||||||
|
{"label":"3", "x":3.25, "y":0},
|
||||||
|
{"label":"W", "x":2.75, "y":1},
|
||||||
|
{"label":"A", "x":2, "y":2},
|
||||||
|
{"label":"L_SHIFT", "x":1, "y":3, "w":1.5},
|
||||||
|
{"label":"Z", "x":2.5, "y":3},
|
||||||
|
{"label":"S", "x":3, "y":2},
|
||||||
|
{"label":"E", "x":3.75, "y":1},
|
||||||
|
{"label":"4", "x":4.25, "y":0},
|
||||||
|
{"label":"5", "x":5.25, "y":0},
|
||||||
|
{"label":"R", "x":4.75, "y":1},
|
||||||
|
{"label":"D", "x":4, "y":2},
|
||||||
|
{"label":"X", "x":3.5, "y":3},
|
||||||
|
{"label":"C", "x":4.5, "y":3},
|
||||||
|
{"label":"F", "x":5, "y":2},
|
||||||
|
{"label":"T", "x":5.75, "y":1},
|
||||||
|
{"label":"6", "x":6.25, "y":0},
|
||||||
|
{"label":"7", "x":7.25, "y":0},
|
||||||
|
{"label":"Y", "x":6.75, "y":1},
|
||||||
|
{"label":"G", "x":6, "y":2},
|
||||||
|
{"label":"V", "x":5.5, "y":3},
|
||||||
|
{"label":"B", "x":6.5, "y":3},
|
||||||
|
{"label":"H", "x":7, "y":2},
|
||||||
|
{"label":"U", "x":7.75, "y":1},
|
||||||
|
{"label":"8", "x":8.25, "y":0},
|
||||||
|
{"label":"NumPad_7", "x":20, "y":1},
|
||||||
|
{"label":"9", "x":9.25, "y":0},
|
||||||
|
{"label":"I", "x":8.75, "y":1},
|
||||||
|
{"label":"J", "x":8, "y":2},
|
||||||
|
{"label":"N", "x":7.5, "y":3},
|
||||||
|
{"label":"M", "x":8.5, "y":3},
|
||||||
|
{"label":"K", "x":9, "y":2},
|
||||||
|
{"label":"O", "x":9.75, "y":1},
|
||||||
|
{"label":"0", "x":10.25, "y":0},
|
||||||
|
{"label":"NumPad_3", "x":22, "y":3},
|
||||||
|
{"label":"+", "x":11.25, "y":0},
|
||||||
|
{"label":"P", "x":10.75, "y":1},
|
||||||
|
{"label":"L", "x":10, "y":2},
|
||||||
|
{"label":",", "x":9.5, "y":3},
|
||||||
|
{"label":".", "x":10.5, "y":3},
|
||||||
|
{"label":"Colon", "x":11, "y":2},
|
||||||
|
{"label":"@", "x":11.75, "y":1},
|
||||||
|
{"label":"-", "x":12.25, "y":0},
|
||||||
|
{"label":"NumPad_1", "x":20, "y":3},
|
||||||
|
{"label":"£", "x":13.25, "y":0},
|
||||||
|
{"label":"*", "x":12.75, "y":1},
|
||||||
|
{"label":";", "x":12, "y":2},
|
||||||
|
{"label":"/", "x":11.5, "y":3},
|
||||||
|
{"label":"R_SHIFT", "x":12.5, "y":3, "w":1.5},
|
||||||
|
{"label":"=", "x":13, "y":2},
|
||||||
|
{"label":"Up_Arrow", "x":13.75, "y":1},
|
||||||
|
{"label":"HOME", "x":14.25, "y":0},
|
||||||
|
{"label":"NumPad_9", "x":8.25, "y":20},
|
||||||
|
{"label":"DEL", "x":15.25, "y":0},
|
||||||
|
{"label":"RETURN", "x":14, "y":2, "w":2},
|
||||||
|
{"label":"→", "x":15, "y":3},
|
||||||
|
{"label":"↓", "x":14, "y":3},
|
||||||
|
{"label":"F1", "x":17.5, "y":0, "w":1.5},
|
||||||
|
{"label":"F3", "x":17.5, "y":1, "w":1.5},
|
||||||
|
{"label":"F5", "x":17.5, "y":2, "w":1.5},
|
||||||
|
{"label":"F7", "x":17.5, "y":3, "w":1.5},
|
||||||
|
{"label":"NumPad_Dot", "x":22, "y":4},
|
||||||
|
{"label":"NumPad_8", "x":21, "y":1},
|
||||||
|
{"label":"NumPad_2", "x":20, "y":3},
|
||||||
|
{"label":"NumPad_4", "x":20, "y":2},
|
||||||
|
{"label":"NumPad_6", "x":22, "y":2},
|
||||||
|
{"label":"NumPad_0", "x":20, "y":4, "w":2},
|
||||||
|
{"label":"RESTORE", "x":14.75, "y":1, "w":1.5},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "key64_rp2040.h"
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/* Copyright 2023 K-rnivoro
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define ____ KC_TRNS
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
RGB LED (Replacement of original C-64 Power LED) showing current layout:
|
||||||
|
|
||||||
|
- PC Mode: LED Green
|
||||||
|
- Any SHIFT pressed (in PC Mode): LED Cyan (Green+Blue)
|
||||||
|
- Commodore Key (C=) pressed (in PC Mode): LED Yellow (Green+Red)
|
||||||
|
- Commodore-64 Emulator Mode: LED Red
|
||||||
|
- Commodore-16 and Plus/4 Emulator Mode: LED Blue
|
||||||
|
- Commodore PET Emulator Mode: LED Purple (Blue+Red)
|
||||||
|
- Spectrum Emulator: LED Yellow.
|
||||||
|
*/
|
||||||
|
//R-Pi Pico PCB LED as Power LED
|
||||||
|
#define power_led GP25
|
||||||
|
|
||||||
|
//R-Pi Pico GPIO Output for RGB LED
|
||||||
|
#define red_led GP28
|
||||||
|
#define green_led GP27
|
||||||
|
#define blue_led GP26
|
||||||
|
|
||||||
|
//#define red_led GP18
|
||||||
|
//#define green_led GP19
|
||||||
|
//#define blue_led GP20
|
||||||
|
|
||||||
|
//Flags from BMC64 emulator running on Raspberry Pi 3B or 3B+ to auto-change Keyboard Layout
|
||||||
|
#define bmc64_p0 GP19 // Connected to Rarpberry Pi 3B GPIO 9
|
||||||
|
#define bmc64_p1 GP20 // Connected to Rarpberry Pi 3B GPIO 10
|
||||||
|
#define bmc64_p2 GP18 // Connected to Rarpberry Pi 3B GPIO 11
|
||||||
|
|
||||||
|
//#define bmc64_p0 GP26 // Connected to Rarpberry Pi 3B GPIO 9
|
||||||
|
//#define bmc64_p1 GP27 // Connected to Rarpberry Pi 3B GPIO 10
|
||||||
|
//#define bmc64_p2 GP28 // Connected to Rarpberry Pi 3B GPIO 11
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Comment or uncomment one of these defines, accordingly with the type of RGB LED being used: Common Anode or Common Cathode
|
||||||
|
//#define LED_COMMON_CATHODE
|
||||||
|
#define LED_COMMON_ANODE
|
||||||
|
|
||||||
|
#if defined(LED_COMMON_ANODE)
|
||||||
|
#define setLedOn( led ) writePinLow( led )
|
||||||
|
#define setLedOff( led ) writePinHigh( led )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(LED_COMMON_CATHODE)
|
||||||
|
#define setLedOn( led ) writePinHigh( led )
|
||||||
|
#define setLedOff( led ) writePinLow( led )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Pimmodore keyboard modes
|
||||||
|
|
||||||
|
#define BMC64_PIMMODORE_MODE_PC 0
|
||||||
|
#define BMC64_PIMMODORE_MODE_C64 1
|
||||||
|
#define BMC64_PIMMODORE_MODE_C128 2
|
||||||
|
#define BMC64_PIMMODORE_MODE_PETB 3
|
||||||
|
#define BMC64_PIMMODORE_MODE_PETG 4
|
||||||
|
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k26, k27, \
|
||||||
|
k30, k31, k32, k33, k34, k35, k36, k37, k38,\
|
||||||
|
k40, k41, k42, k43, k44, k45, k46, k47, k48,\
|
||||||
|
k50, k51, k52, k53, k54, k55, k56, k57, k58,\
|
||||||
|
k60, k61, k62, k63, k64, k65, k66, k67, k68,\
|
||||||
|
k70, k71, k72, k73, k74, k75, k76, k77, k78,\
|
||||||
|
k80, k81, k82, k83, k84, k88 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, KC_NO }, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15, k16, k17, KC_NO }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25, k26, k27, KC_NO }, \
|
||||||
|
{ k30, k31, k32, k33, k34, k35, k36, k37, k38 }, \
|
||||||
|
{ k40, k41, k42, k43, k44, k45, k46, k47, k48 }, \
|
||||||
|
{ k50, k51, k52, k53, k54, k55, k56, k57, k58 }, \
|
||||||
|
{ k60, k61, k62, k63, k64, k65, k66, k67, k68 }, \
|
||||||
|
{ k70, k71, k72, k73, k74, k75, k76, k77, k78 }, \
|
||||||
|
{ k80, k81, k82, k83, k84, KC_NO, KC_NO, KC_NO, k88 } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,744 @@
|
|||||||
|
/* Copyright 2023 K-rnivoro (www.keymmodore.com)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
The Commodore layouts are compatible with Bare Metal Commodore 64, Combian, VICE and CCS64 Emulators
|
||||||
|
You need to set "Keyboard Settings" in "Positional" Layout in Emulator for C64.
|
||||||
|
For Plus/4, C-128 and PET you need to set as "Positional (User)" and use custom .vkm files.
|
||||||
|
The ZX layouts are compatible with ZXBaremulator with no custom configuration needed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define PC 0 /* PC Compatible Mode */
|
||||||
|
#define LSHFT 1 /* Left SHIFT Key */
|
||||||
|
#define RSHFT 2 /* Right SHIFT Key */
|
||||||
|
#define CKEY 3 /* Commodore Key as a Function Key (like 60% style Keyboards) */
|
||||||
|
#define ZX 4 /* ZX Spectrum compatible layout with Cursor and QAOP-Space support for ZXBaremulator*/
|
||||||
|
#define RSFT_ZX 5 /* Right Shift Key pressed as a Function Key for ZXBaremulator*/
|
||||||
|
#define CKEY_ZX 6 /* Commodore Key pressed as a Function Key in ZX layer for ZXBaremulator*/
|
||||||
|
#define CKEY_SHFT_ZX 7 /* Commodore Key and Left Shift pressed as a Function Keys in ZX layer for ZXBaremulator*/
|
||||||
|
#define C64 8 /* Commodore-64, VIC-20 Plus/4, C-16 and C116 layer. (need custom .vkm for emulators) */
|
||||||
|
#define C128 9 /* Commodore 128 Keyboard mapping. (need custom .vkm for emulators) */
|
||||||
|
#define C128_RSFT 10 /* Commodore 128 Keyboard with Right Shift pressed mapping (allow to access exclusive C-128 Keys). */
|
||||||
|
#define PETBUS 11 /* Commodore PET Business Keyboard mapping (upper case letters with SHIFT key). */
|
||||||
|
#define PETBUS_C 12 /* Commodore PET Business Keyboard mapping with C= Key. Allows access to NumPad keys. */
|
||||||
|
#define PETGRAPH 13 /* Commodore PET Graphics Keyboard mapping. Allows access right legend PETSCII with SHIFT key. */
|
||||||
|
#define PETGRAPH_C 14 /* Commodore PET Graphics Keyboard mapping with C= Key. Allow access left legend PETSCII codes with C= key. */
|
||||||
|
#define CBM 15 /* Commodore Key pressed in Emulation mode. Allows to go back to PC Mode pressing CONTROL. */
|
||||||
|
|
||||||
|
|
||||||
|
static int current_keyb_mode = PC; // Will reflect the Keyboard mode when BMC64 is running
|
||||||
|
|
||||||
|
//Definition of non standard keys in the C-64 Keyboard.
|
||||||
|
enum my_keycodes {
|
||||||
|
TECLA_7 = SAFE_RANGE,
|
||||||
|
TECLA_ACOR,
|
||||||
|
TECLA_CCOR,
|
||||||
|
TECLA_ZXACOR,
|
||||||
|
TECLA_ZXCCOR,
|
||||||
|
BLK,
|
||||||
|
WHT,
|
||||||
|
RED,
|
||||||
|
CYN,
|
||||||
|
PUR,
|
||||||
|
GRN,
|
||||||
|
BLU,
|
||||||
|
YEL,
|
||||||
|
S_BLK,
|
||||||
|
S_RED,
|
||||||
|
S_PUR,
|
||||||
|
S_BLU,
|
||||||
|
S_WHT,
|
||||||
|
S_CYN,
|
||||||
|
S_GRN,
|
||||||
|
S_YEL,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[PC] = LAYOUT(
|
||||||
|
KC_1, QK_GESC, CTL_T(KC_TAB), KC_LALT, KC_SPC, MO(CKEY), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, LM(LSHFT,MOD_LSFT), KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, KC_P7,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, KC_P3,
|
||||||
|
KC_PLUS, KC_P, KC_L, KC_COMM, KC_DOT, KC_COLON, KC_AT, KC_MINS, KC_P1,
|
||||||
|
KC_BSLS, KC_ASTR, KC_SCLN, KC_SLSH, MO(RSHFT), KC_EQL, KC_UP, KC_HOME, KC_P9,
|
||||||
|
KC_DEL, KC_ENT, KC_RGHT, KC_DOWN, KC_F1, KC_F3, KC_F5, KC_F7, KC_PDOT,
|
||||||
|
KC_P8, KC_P2, KC_P4, KC_P6, KC_P0, KC_BSPC
|
||||||
|
),
|
||||||
|
|
||||||
|
[LSHFT] = LAYOUT(
|
||||||
|
____, ____, ____, ____, ____, KC_NO, ____, KC_DQUO,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, KC_AMPR,
|
||||||
|
TECLA_7, ____, ____, ____, ____, ____, ____, KC_9, ____,
|
||||||
|
KC_0, ____, ____, ____, ____, ____, ____, KC_CIRC, ____,
|
||||||
|
____, ____, ____, ____, ____, TECLA_ACOR, ____, ____, ____,
|
||||||
|
____, ____, TECLA_CCOR, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____
|
||||||
|
),
|
||||||
|
|
||||||
|
[RSHFT] = LAYOUT(
|
||||||
|
KC_EXLM, KC_TILD, ____, ____, S(KC_SPC), KC_NO, S(KC_Q), KC_DQUO,
|
||||||
|
KC_HASH, S(KC_W), S(KC_A), ____, S(KC_Z), S(KC_S), S(KC_E), KC_DLR,
|
||||||
|
KC_PERC, S(KC_R), S(KC_D), S(KC_X), S(KC_C), S(KC_F), S(KC_T), KC_AMPR,
|
||||||
|
KC_QUOT, S(KC_Y), S(KC_G), S(KC_V), S(KC_B), S(KC_H), S(KC_U), KC_LPRN, ____,
|
||||||
|
KC_RPRN, S(KC_I), S(KC_J), S(KC_N), S(KC_M), S(KC_K), S(KC_O), KC_CIRC, ____,
|
||||||
|
____, S(KC_P), S(KC_L), KC_LABK, KC_RABK, KC_LBRC, ____, KC_UNDS, ____,
|
||||||
|
KC_PIPE, ____, KC_RBRC, KC_QUES, ____, ____, S(KC_UP), S(KC_HOME), ____,
|
||||||
|
S(KC_DEL), S(KC_ENT), KC_LEFT, KC_UP, KC_F2, KC_F4, KC_F6, KC_F8, ____,
|
||||||
|
____, ____, ____, ____, ____, S(KC_BSPC)
|
||||||
|
),
|
||||||
|
|
||||||
|
[CKEY] = LAYOUT(
|
||||||
|
KC_F1, KC_GRV, KC_LCTL, ____, ____, ____, KC_PGUP, KC_F2,
|
||||||
|
KC_F3, KC_UP, KC_LEFT, ____, TO(ZX), KC_DOWN, KC_PGDN, KC_F4,
|
||||||
|
KC_F5, ____, KC_RGHT, ____, KC_CALC, ____, ____, KC_F6,
|
||||||
|
KC_F7, ____, ____, ____, ____, ____, KC_PGUP, KC_F8, ____,
|
||||||
|
KC_F9, KC_UP, KC_LEFT, ____, ____, KC_DOWN, KC_PGDN, KC_F10, ____,
|
||||||
|
KC_F11, KC_PSCR, KC_RGHT, KC_VOLD, KC_VOLU, KC_LCBR, KC_LSCR, KC_F12, ____,
|
||||||
|
____, KC_LNUM, KC_RCBR, KC_MUTE, ____, ____, KC_PGUP, KC_END, ____,
|
||||||
|
KC_INS, ____, KC_LEFT, KC_UP, TO(C64), TO(C128), TO(PETGRAPH), ____, ____,
|
||||||
|
____, ____, ____, ____, ____, KC_PGDN
|
||||||
|
),
|
||||||
|
|
||||||
|
[ZX] = LAYOUT(
|
||||||
|
KC_1, KC_ESC, KC_LCTL, KC_LALT, KC_SPC, MO(CKEY_ZX), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, KC_LSFT, KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, KC_P7,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, KC_P3,
|
||||||
|
RCTL(KC_K), KC_P, KC_L, RCTL(KC_N), RCTL(KC_M), RCTL(KC_Z), RCTL(KC_2), RCTL(KC_J), KC_P1,
|
||||||
|
RCTL(KC_X), RCTL(KC_B), RCTL(KC_O), RCTL(KC_V), MO(RSFT_ZX), RCTL(KC_L), RCTL(KC_H), KC_PAUSE, KC_P9,
|
||||||
|
KC_DEL, KC_ENT, LSFT(KC_8), LSFT(KC_6), KC_F1, LALT(KC_K), KC_F8, LALT(KC_F8), KC_PDOT,
|
||||||
|
KC_P8, KC_P2, KC_P4, KC_P6, KC_P0, KC_BSPC
|
||||||
|
),
|
||||||
|
|
||||||
|
[RSFT_ZX] = LAYOUT(
|
||||||
|
RCTL(KC_1), KC_ESC, KC_NO, KC_LALT, KC_SPC, KC_NO, LSFT(KC_Q), RCTL(KC_P),
|
||||||
|
RCTL(KC_3), LSFT(KC_W), LSFT(KC_A), ____, LSFT(KC_Z), LSFT(KC_S), LSFT(KC_E), RCTL(KC_4),
|
||||||
|
RCTL(KC_5), LSFT(KC_R), LSFT(KC_D), LSFT(KC_X), LSFT(KC_C), LSFT(KC_F), LSFT(KC_T), RCTL(KC_6),
|
||||||
|
RCTL(KC_7), LSFT(KC_Y), LSFT(KC_G), LSFT(KC_V), LSFT(KC_B), LSFT(KC_H), LSFT(KC_U), RCTL(KC_8), ____,
|
||||||
|
RCTL(KC_9), LSFT(KC_I), LSFT(KC_J), LSFT(KC_N), LSFT(KC_M), LSFT(KC_K), LSFT(KC_O), RCTL(KC_0), ____,
|
||||||
|
RCTL(KC_K), LSFT(KC_P), LSFT(KC_L), RCTL(KC_R), RCTL(KC_T), TECLA_ZXACOR, RCTL(KC_2), RCTL(KC_J), ____,
|
||||||
|
RCTL(KC_X), RCTL(KC_B), TECLA_ZXCCOR, RCTL(KC_C), ____, RCTL(KC_L), RCTL(KC_H), KC_PAUSE, ____,
|
||||||
|
KC_DEL, KC_ENT, LSFT(KC_5), LSFT(KC_7), KC_F1, LALT(KC_K), KC_F8, LALT(KC_F8), ____,
|
||||||
|
____, ____, ____, ____, ____, KC_BSPC
|
||||||
|
),
|
||||||
|
|
||||||
|
[CKEY_ZX] = LAYOUT(
|
||||||
|
BLK, ____, TO(PC), ____, ____, ____, ____, WHT,
|
||||||
|
RED, ____, ____, MO(CKEY_SHFT_ZX), ____, ____, ____, CYN,
|
||||||
|
PUR, ____, ____, ____, ____, ____, ____, GRN,
|
||||||
|
BLU, ____, ____, ____, ____, ____, ____, YEL, ____,
|
||||||
|
LSFT(KC_4), ____, ____, ____, ____, ____, ____, LSFT(KC_3), ____,
|
||||||
|
____, ____, ____, KC_PGUP, KC_PGDN, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, KC_UP, KC_HOME, ____,
|
||||||
|
KC_END, ____, KC_RIGHT, KC_DOWN, LALT(KC_F2), LALT(KC_F3), LALT(KC_F4), KC_F9, ____,
|
||||||
|
____, ____, ____, ____, ____, KC_LEFT
|
||||||
|
),
|
||||||
|
|
||||||
|
[CKEY_SHFT_ZX] = LAYOUT(
|
||||||
|
S_BLK, ____, KC_NO, ____, ____, ____, ____, S_WHT,
|
||||||
|
S_RED, ____, ____, ____, KC_NO, ____, ____, S_CYN,
|
||||||
|
S_PUR, ____, ____, KC_NO, ____, ____, ____, S_GRN,
|
||||||
|
S_BLU, ____, ____, ____, ____, ____, ____, S_YEL, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____
|
||||||
|
),
|
||||||
|
|
||||||
|
[C64] = LAYOUT(
|
||||||
|
KC_1, KC_GRV, KC_TAB, KC_ESC, KC_SPC, LM(CBM,MOD_LCTL), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, KC_LSFT, KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, KC_P7,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, KC_P3,
|
||||||
|
KC_MINS, KC_P, KC_L, KC_COMM, KC_DOT, KC_SCLN, KC_LBRC, KC_EQL, KC_P1,
|
||||||
|
KC_INS, KC_RBRC, KC_QUOT, KC_SLSH, KC_RSFT, KC_BSLS, KC_DEL, KC_HOME, KC_P9,
|
||||||
|
KC_BSPC, KC_ENT, KC_RGHT, KC_DOWN, KC_F1, KC_F3, KC_F5, KC_F7, KC_PDOT,
|
||||||
|
KC_P8, KC_P2, KC_P4, KC_P6, KC_P0, KC_PGUP
|
||||||
|
),
|
||||||
|
|
||||||
|
[C128] = LAYOUT(
|
||||||
|
KC_1, KC_GRV, KC_TAB, KC_ESC, KC_SPC, LM(CBM,MOD_LCTL), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, KC_LSFT, KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, KC_P7,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, KC_P3,
|
||||||
|
KC_MINS, KC_P, KC_L, KC_COMM, KC_DOT, KC_SCLN, KC_LBRC, KC_EQL, KC_P1,
|
||||||
|
KC_INS, KC_RBRC, KC_QUOT, KC_SLSH, MO(C128_RSFT), KC_BSLS, KC_DEL, KC_HOME, KC_P9,
|
||||||
|
KC_BSPC, KC_ENT, KC_RGHT, KC_DOWN, KC_F1, KC_F3, KC_F5, KC_F7, KC_PDOT,
|
||||||
|
KC_P8, KC_P2, KC_P4, KC_P6, KC_P0, KC_PGUP
|
||||||
|
),
|
||||||
|
|
||||||
|
[C128_RSFT] = LAYOUT(
|
||||||
|
KC_P1, KC_PAST, KC_F11, KC_F9, S(KC_SPC), ____, S(KC_Q), KC_P2,
|
||||||
|
KC_P3, S(KC_W), S(KC_A), ____, S(KC_Z), S(KC_S), S(KC_E), KC_P4,
|
||||||
|
KC_P5, S(KC_R), S(KC_D), S(KC_X), S(KC_C), S(KC_F), S(KC_T), KC_P6,
|
||||||
|
KC_P7, S(KC_Y), S(KC_G), S(KC_V), S(KC_B), S(KC_H), S(KC_U), KC_P8, ____,
|
||||||
|
KC_P9, S(KC_I), S(KC_J), S(KC_N), S(KC_M), S(KC_K), S(KC_O), KC_P0, ____,
|
||||||
|
KC_PPLS, S(KC_P), S(KC_L), KC_LABK, KC_PDOT, KC_COLON, KC_LCBR, KC_PMNS, ____,
|
||||||
|
S(KC_INS), KC_RCBR, KC_DQUO, KC_QUES, ____, KC_PIPE, KC_F10, S(KC_HOME), ____,
|
||||||
|
S(KC_BSPC), KC_PENT, KC_LEFT, KC_UP, KC_F2, KC_F4, KC_F6, KC_PSLS, ____,
|
||||||
|
____, ____, ____, ____, ____, S(KC_PGUP)
|
||||||
|
),
|
||||||
|
|
||||||
|
[PETGRAPH] = LAYOUT(
|
||||||
|
KC_1, KC_GRV, KC_INS, KC_ESC, KC_SPC, MO(PETGRAPH_C), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, KC_LSFT, KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, ____,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, ____,
|
||||||
|
KC_MINS, KC_P, KC_L, KC_COMM, KC_DOT, KC_SCLN, KC_LBRC, KC_EQL, ____,
|
||||||
|
KC_TAB, KC_RBRC, KC_QUOT, KC_SLSH, KC_RSFT, KC_BSLS, KC_DEL, KC_HOME, ____,
|
||||||
|
KC_BSPC, KC_ENT, KC_RGHT, KC_DOWN, KC_NO, KC_NO, KC_NO, KC_NO, ____,
|
||||||
|
____, ____, ____, ____, ____, KC_BSPC
|
||||||
|
),
|
||||||
|
|
||||||
|
[PETGRAPH_C] = LAYOUT(
|
||||||
|
KC_F1, ____, TO(PC), ____, ____, ____, S(KC_F10), KC_F2,
|
||||||
|
KC_F3, S(KC_3), S(KC_0), ____, S(KC_F11), KC_RABK, S(KC_1), KC_F4,
|
||||||
|
KC_F5, S(KC_2), KC_LABK, KC_PIPE, S(KC_PGUP), KC_DQUO, S(KC_F3), KC_F6,
|
||||||
|
KC_UP, S(KC_7), S(KC_F5), S(KC_PGDN), S(KC_PSLS), S(KC_4), S(KC_8), KC_LEFT, ____,
|
||||||
|
KC_F9, S(KC_F2), S(KC_5), KC_LALT, S(KC_UP), S(KC_F1), S(KC_9), ____, ____,
|
||||||
|
S(KC_F6), KC_QUES, S(KC_6), KC_PGUP, KC_PGDN, KC_PMNS, S(KC_F4), S(KC_PAST), ____,
|
||||||
|
S(KC_LEFT), KC_TILD, KC_PPLS, KC_PSLS, ____, ____, S(KC_DEL), ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, TO(PETBUS), C(KC_F7), ____,
|
||||||
|
____, ____, ____, ____, ____, ____
|
||||||
|
),
|
||||||
|
|
||||||
|
[PETBUS] = LAYOUT(
|
||||||
|
KC_1, KC_GRV, KC_TAB, KC_ESC, KC_SPC, MO(PETBUS_C), KC_Q, KC_2,
|
||||||
|
KC_3, KC_W, KC_A, KC_LSFT, KC_Z, KC_S, KC_E, KC_4,
|
||||||
|
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
|
||||||
|
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8, KC_P7,
|
||||||
|
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0, KC_P3,
|
||||||
|
KC_MINS, KC_P, KC_L, KC_COMM, KC_DOT, KC_SCLN, KC_LBRC, KC_EQL, KC_P1,
|
||||||
|
KC_INS, KC_RBRC, KC_QUOT, KC_SLSH, KC_RSFT, KC_BSLS, KC_DEL, KC_HOME, KC_P9,
|
||||||
|
KC_BSPC, KC_ENT, KC_RGHT, KC_DOWN, KC_F1, KC_F3, KC_F5, KC_F7, KC_PDOT,
|
||||||
|
KC_P8, KC_P2, KC_P4, KC_P6, KC_P0, KC_BSPC
|
||||||
|
),
|
||||||
|
|
||||||
|
[PETBUS_C] = LAYOUT(
|
||||||
|
KC_P1, KC_NO, TO(PC), KC_NO, ____, ____, KC_NO, KC_P2,
|
||||||
|
KC_P3, KC_NO, KC_NO, ____, KC_NO, KC_NO, KC_NO, KC_P4,
|
||||||
|
KC_P5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P6,
|
||||||
|
KC_P7, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P8, ____,
|
||||||
|
KC_P9, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P0, ____,
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_PDOT, KC_F10, KC_NO, KC_NO, ____,
|
||||||
|
KC_NO, KC_NO, KC_F11, KC_NO, ____, KC_NO, KC_NO, ____, ____,
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, C(KC_F7), ____,
|
||||||
|
____, ____, ____, ____, ____, ____
|
||||||
|
),
|
||||||
|
|
||||||
|
[CBM] = LAYOUT(
|
||||||
|
____, ____, TO(PC), ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____, ____, ____, ____,
|
||||||
|
____, ____, ____, ____, ____, ____
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record)
|
||||||
|
{
|
||||||
|
switch (keycode)
|
||||||
|
{
|
||||||
|
case TECLA_7:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
register_code(KC_QUOT);
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_QUOT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case TECLA_ACOR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
register_code(KC_LBRC);
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_LBRC);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case TECLA_CCOR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
register_code(KC_RBRC);
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_RBRC);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case TECLA_ZXACOR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
register_code(KC_Y);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_Y);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case TECLA_ZXCCOR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
register_code(KC_U);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_U);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case BLK:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_0);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_0);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case WHT:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_7);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_7);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case RED:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_2);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_2);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case CYN:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_5);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_5);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case PUR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_3);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_3);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case GRN:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_4);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_4);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case BLU:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_1);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_1);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case YEL:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_6);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_6);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_BLK:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_WHT:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_7);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_7);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_RED:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_2);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_CYN:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_5);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_PUR:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_3);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_GRN:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_4);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_BLU:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_1);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case S_YEL:
|
||||||
|
if (record->event.pressed)
|
||||||
|
{
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
register_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
unregister_code(KC_RCTL);
|
||||||
|
wait_ms(25);
|
||||||
|
register_code(KC_6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unregister_code(KC_6);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Enable red, green and blue LEDS.
|
||||||
|
//Turn On internal Power LED.
|
||||||
|
// Set BMC64 Pins as Inputs
|
||||||
|
|
||||||
|
void keyboard_pre_init_user(void) {
|
||||||
|
|
||||||
|
setPinOutput(red_led);
|
||||||
|
setPinOutput(green_led);
|
||||||
|
setPinOutput(blue_led);
|
||||||
|
setPinOutput(power_led);
|
||||||
|
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
writePinHigh(power_led);
|
||||||
|
|
||||||
|
|
||||||
|
setPinInput(bmc64_p0);
|
||||||
|
setPinInput(bmc64_p1);
|
||||||
|
setPinInput(bmc64_p2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Change RGB LED according which Layer is On.
|
||||||
|
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
|
||||||
|
switch (get_highest_layer(state)) {
|
||||||
|
case PC:
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case RSHFT:
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case CKEY:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case ZX: //yellow
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case CKEY_ZX: //white
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case RSFT_ZX: //red
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOff(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case CKEY_SHFT_ZX: //OFF
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOff(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case C64:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOff(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case C128:
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOff(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case C128_RSFT:
|
||||||
|
setLedOff(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case PETGRAPH:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOff(blue_led);
|
||||||
|
break;
|
||||||
|
case PETGRAPH_C:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case PETBUS:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOff(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case PETBUS_C:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
case CBM:
|
||||||
|
setLedOn(red_led);
|
||||||
|
setLedOn(green_led);
|
||||||
|
setLedOn(blue_led);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_scan_user(void)
|
||||||
|
{
|
||||||
|
// Read the machine class being executed
|
||||||
|
int read_keyb_mode = 0;
|
||||||
|
read_keyb_mode += readPin(bmc64_p2) << 2;
|
||||||
|
read_keyb_mode += readPin(bmc64_p1) << 1;
|
||||||
|
read_keyb_mode += readPin(bmc64_p0) << 0;
|
||||||
|
|
||||||
|
// Is there a relevant change in the keyboard mode?
|
||||||
|
if ( current_keyb_mode != read_keyb_mode ) {
|
||||||
|
|
||||||
|
current_keyb_mode = read_keyb_mode;
|
||||||
|
layer_clear();
|
||||||
|
|
||||||
|
switch (current_keyb_mode) {
|
||||||
|
case BMC64_PIMMODORE_MODE_C64: // C64; VIC20; Plus 4
|
||||||
|
layer_move(C64);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMC64_PIMMODORE_MODE_C128: // Commodore 128
|
||||||
|
layer_move(C128);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMC64_PIMMODORE_MODE_PETB: // PET Business
|
||||||
|
layer_move(PETBUS);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMC64_PIMMODORE_MODE_PETG: // PET Graph
|
||||||
|
layer_move(PETGRAPH);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
layer_move(PC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
Commodore64 keyboard firmware
|
||||||
|
======================
|
||||||
|
|
||||||
|
## Quantum MK Firmware
|
||||||
|
|
||||||
|
For the full Quantum feature list, see [the parent readme](/).
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
Download or clone the whole firmware and navigate to the keyboards/Commodore64 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||||
|
|
||||||
|
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||||
|
|
||||||
|
### Default
|
||||||
|
|
||||||
|
To build with the default keymap, simply run `make default`.
|
||||||
|
|
||||||
|
### Other Keymaps
|
||||||
|
|
||||||
|
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||||
|
|
||||||
|
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make [default|jack|<name>]
|
||||||
|
```
|
||||||
|
|
||||||
|
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# This file intentionally left blank
|
||||||
|
|
||||||
Reference in New Issue
Block a user