Indentar layout mejor

This commit is contained in:
Cat /dev/Nulo 2021-12-13 16:41:41 -03:00
parent b73825843c
commit 6fc5ebf7a3
2 changed files with 20 additions and 46 deletions

View file

@ -56,8 +56,8 @@
(define key-quote 52) (define key-quote 52)
(define key-backslash 49) (define key-backslash 49)
(define key-backtick 53) (define key-backtick 53)
(define key-left-bracket 47) (define key-left-bracket 47) (define key-lbrack 47)
(define key-right-bracket 48) (define key-right-bracket 48) (define key-rbrack 48)
(define key-period 55) (define key-. 55) (define key-period 55) (define key-. 55)
(define key-slash 56) (define key-/ 56) (define key-slash 56) (define key-/ 56)

View file

@ -1,30 +1,13 @@
;;; this is the qwerty layout
(include "keycodes.scm") (include "keycodes.scm")
;; What are the rows and columns we care about?
(define rows (list 0 1 2 3)) (define rows (list 0 1 2 3))
(define columns (list 0 1 2 3 4 5 6 7 8 9 10 11)) (define columns (list 0 1 2 3 4 5 6 7 8 9 10 11))
;; Which GPIO pins are responsible for each row or column?
;; These are the pins used by the kit-based Atreus; the Keyboardio Atreus uses
;; a different set of pins.
(define row-pins (vector 5 9 16 10)) (define row-pins (vector 5 9 16 10))
; +#define MATRIX_ROW_PINS { C6, B5, B2, B6 } ; +#define MATRIX_ROW_PINS { C6, B5, B2, B6 }
(define column-pins (vector 21 19 20 18 15 7 6 4 3 2 0 1)) (define column-pins (vector 21 19 20 18 15 7 6 4 3 2 0 1))
; +#define MATRIX_COL_PINS { F4, F6, F5, F7, B1, E6, D7, D4, D0, D1, D2, D3 } ; +#define MATRIX_COL_PINS { F4, F6, F5, F7, B1, E6, D7, D4, D0, D1, D2, D3 }
;; If you have a kit where the PCB is installed upside-down, uncomment this:
;; (set! column-pins (vector 11 12 18 19 10 4 7 8 9 5 6))
;; ;; Upside-down PCB makes the columns backwards but also trades ctrl and alt;
;; ;; this hack only works for layouts where ctrl and alt are in standard place.
;; (set! mod-alt (modify 1))
;; (set! mod-ctrl (modify 3))
;; The above should be handled by a compile-time environment variable but that
;; isn't yet part of Microscheme:
;; https://github.com/ryansuchocki/microscheme/issues/32
;; we have to declare this up front and set it later because of circularity ;; we have to declare this up front and set it later because of circularity
(define layers #f) (define layers #f)
(define current-layer #f) (define current-layer #f)
@ -35,56 +18,47 @@
(define (set-layer n) (define (set-layer n)
(lambda (_) (set! current-layer (vector-ref layers n)))) (lambda (_) (set! current-layer (vector-ref layers n))))
;; On the Atreus Classic, we need to expose backtick on the fn layer, but on
;; the Keyboardio Atreus it has its own key, so we put percent there instead.
(define backtick-or-percent
(sft key-5)
;;key-backtick
)
;;;; layers ;;;; layers
(define noop 0) (define noop 0)
(define base-layer (define base-layer
(vector key-q key-w key-e key-r key-t noop noop key-y key-u key-i key-o key-p (vector key-q key-w key-e key-r key-t noop noop key-y key-u key-i key-o key-p
key-a key-s key-d key-f key-g noop noop key-h key-j key-k key-l key-semicolon key-a key-s key-d key-f key-g noop noop key-h key-j key-k key-l key-semicolon
key-z key-x key-c key-v key-b key-backtick key-backslash key-n key-m key-comma key-period key-slash key-z key-x key-c key-v key-b key-backtick key-backslash key-n key-m key-comma key-period key-slash
key-esc key-tab mod-super mod-shift key-backspace mod-ctrl key-esc key-tab mod-super mod-shift key-backspace mod-ctrl
mod-alt key-space fn key-dash key-quote key-enter)) mod-alt key-space fn key-dash key-quote key-enter))
(define fn-layer (define fn-layer
(vector (sft key-1) (sft key-2) key-up (sft key-4) backtick-or-percent noop (vector (sft key-1) (sft key-2) key-up (sft key-4) (sft key-5) noop
noop key-page-up key-7 key-8 key-9 key-backspace noop key-page-up key-7 key-8 key-9 key-backspace
(sft key-9) key-left key-down key-right (sft key-0) noop (sft key-9) key-left key-down key-right (sft key-0) noop
noop key-page-down key-4 key-5 key-6 (altgr key-quote) noop key-page-down key-4 key-5 key-6 (altgr key-quote)
key-left-bracket key-right-bracket (sft key-3) (sft key-left-bracket) key-lbrack key-rbrack (sft key-3) (sft key-lbrack) (sft key-rbrack) (sft key-6)
(sft key-right-bracket) (sft key-6) (sft key-7) (sft key-8) key-1 key-2 key-3 (sft key-equal)
(sft key-7) (sft key-8) key-1 key-2 key-3 (sft key-equal)
;; set-layer 2 takes us to l2-layer below; doesn't need to be held ;; set-layer 2 takes us to l2-layer below; doesn't need to be held
(set-layer 2) key-insert mod-super mod-shift key-backspace mod-ctrl (set-layer 2) key-insert mod-super mod-shift key-backspace mod-ctrl
mod-alt key-space fn key-period key-0 key-equal)) mod-alt key-space fn key-period key-0 key-equal))
(define l2-layer (define l2-layer
(vector key-insert key-home key-up key-end key-page-up noop (vector key-insert key-home key-up key-end key-page-up noop
noop key-up key-f7 key-f8 key-f9 key-f10 noop key-up key-f7 key-f8 key-f9 key-f10
key-delete key-left key-down key-right key-page-down noop key-delete key-left key-down key-right key-page-down noop
noop key-down key-f4 key-f5 key-f6 key-f11 noop key-down key-f4 key-f5 key-f6 key-f11
;; the B key enters the bootloader ;; the B key enters the bootloader
noop key-vol-up noop noop reset noop noop key-vol-up noop noop reset noop
noop noop key-f1 key-f2 key-f3 key-f12 noop noop key-f1 key-f2 key-f3 key-f12
noop key-vol-down mod-super mod-shift key-backspace mod-ctrl noop key-vol-down mod-super mod-shift key-backspace mod-ctrl
;; tapping the fn key brings us back to the base layer mod-alt key-space (set-layer 0) key-printscreen key-scroll-lock key-pause))
mod-alt key-space (set-layer 0) key-printscreen key-scroll-lock key-pause))
(set! layers (vector base-layer fn-layer l2-layer)) (set! layers (vector base-layer fn-layer l2-layer))
(set! current-layer (vector-ref layers 0)) (set! current-layer (vector-ref layers 0))