From b84752c391c5fe515960f77c80d08f313df57f33 Mon Sep 17 00:00:00 2001 From: Mihai Olteanu Date: Tue, 11 May 2021 11:43:07 +0300 Subject: [PATCH] Update examples (add corne example) --- README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2d7e950..9219b5c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ valid key. - [Mugur](#mugur) - [How it works](#how-it-works) -- [QMK Keycodes and Features](#qmk-keycodes-and-features) +- [Features and keycodes](#features-and-keycodes) * [Basic Keycodes](#basic-keycodes) * [Mod-tap](#mod-tap) * [Modifiers](#modifiers) @@ -27,14 +27,16 @@ valid key. * [Combos](#combos) * [Emacs keybound functions](#emacs-keybound-functions) * [User Defined Keys](#user-defined-keys) + * [Insert raw C code (advanced users)](#insert-raw-c-code--advanced-users-) - [Configuration](#configuration) * [Paths and names](#paths-and-names) - * [Rules (rules.mk)](#rules--rulesmk-) * [Configs (config.h)](#configs--configh-) * [Special Keys](#special-keys) - [Supported Keyboards](#supported-keyboards) - [Other points](#other-points) -- [An Extended Example for Ergodox](#an-extended-example-for-ergodox) +- [Full Examples](#full-examples) + * [Ergodox](#ergodox) + * [Corne](#corne) (Table of contents generated with [markdown-toc](http://ecotrust-canada.github.io/markdown-toc/)) @@ -56,10 +58,10 @@ there are the 1, 2 and 3 digits, as expected, and then a macro key that sends "one two three" when pressed. There are other possibilities, qmk features and configurations to try, but that -is the basics of it. See [an extended example for -ergodox](#an-extended-example-for-ergodox) for a more rich mugur layout. +is the basics of it. See the [examples](#full-examples) section for more rich +mugur layouts. -# QMK Keycodes and Features +# Features and keycodes mugur-key is just a term I've invented for any of the symbols, characters, strings or lists that can appear in a mugur-keymap. In the above example, both @@ -216,6 +218,27 @@ the mnemonic and the cadr is any valid mugur-key. (weird_key (C-c a "right?" ENT)))) ``` +## Insert raw C code (advanced users) +All code generated by mugur is found between `START-MUGUR-REGION` and +`END-MUGUR-REGION` comment. For keyboard-specific code, for exploring different +configurations by hand or for features not yet or ever to be provided by mugur, you +can write your own C code or makefile options outside these mugur regions, + +``` +this is my own code + +// START-MUGUR-REGION + +This is code generated by mugur, in keymap.c, rules.mk or config.h files. +The code between these regions is replaced on subsequent mugur-mugur calls. + +// END-MUGUR-REGION + +I can do whatever I want in my own region of code, +and mugur won't touch it + +``` + # Configuration ## Paths and names @@ -326,7 +349,11 @@ name and the particular problem you're facing. section). Consult the qmk documentation and your keyboard README for how to build and flash your keyboard. -# An Extended Example for Ergodox +# Full Examples + +## Ergodox + +This is a full example for a mugur configuration of an Ergodox keyboard. ```emacs-lisp (let ((mugur-qmk-path "/home/mihai/projects/qmk_firmware") @@ -435,3 +462,54 @@ name and the particular problem you're facing. --- --- --- ---)))) ``` + +## Corne + +Full example for a mugur configuration of a corne keyboard kindly provided by +Nik Gaffney. See details on his [crbkd github page](https://github.com/zzkt/crkbd). + +```emacs-lisp +(let ((mugur-qmk-path "~/qmk_firmware") + (mugur-keyboard-name "crkbd") + (mugur-layout-name "LAYOUT_split_3x6_3") + (mugur-keymap-name "zzkt4") + (mugur-tapping-term 175)) + + (mugur-mugur + '(("base" + tab q w e r t y u i o p bspace + C a s d f g h j k l ?\; (LT move ?\') + S z x c v b n m ?\, dot ?\? (MO qmik) + (MO emacs) lapo (G space) ent rapc (TG numeric)) + + ("numeric" + ~ ?\! ?\@ ?\# ?\$ ?\% ?\^ ?\& ?\* - = bspace + 0 1 2 3 4 5 6 7 8 9 0 (LT move ent) + S --- ?\< ?\{ ?\[ ?\( ?\) ?\] ?\} ?\> | (MO emacs) + (TG qmik) C-M --- --- S (TG numeric)) + + ("move" + --- M-v up --- --- --- --- --- --- --- --- --- + C-a left down right C-e --- --- --- --- --- --- --- + --- M-< C-v M-> --- --- --- --- --- --- --- --- + --- --- --- --- --- --- ) + + ("emacs" + esc --- --- (C-x 0) (C-x 2) (C-x 3) (C-x 4 t) --- --- --- --- --- + --- --- M-% --- --- (M-x "gtd" ent) (C-x b) --- --- "λ" --- --- + reset --- M-x C-c --- ?\( ?\) (M-x "magit" ent) --- --- --- --- + --- --- (H-i e) (C-x 8) --- (MO hypm)) + + ("hypm" + --- --- --- --- --- --- --- --- H-i (H-i o) (H-i l) --- + --- --- --- H-d --- --- --- --- --- --- --- --- + --- --- --- --- --- --- --- H-m (H-m s) --- --- --- + --- --- --- --- --- --- ) + + ("qmik" + --- rgb_tog rgb_mod --- --- --- --- --- --- --- --- reset + rgb_sad rgb_vad rgb_hud --- --- --- --- --- --- --- --- --- + rgb_sai rgb_vai rgb_hui --- --- --- --- --- --- --- S --- + --- --- --- --- --- --- ) + ))) +```