Skip to content

Commit

Permalink
Add Feature Overview. Add sections for Dynamic Macros, Mouse Keys. Ad…
Browse files Browse the repository at this point in the history
…d styling, including print. Edit for clarity.
  • Loading branch information
jayliu50 committed Jul 16, 2017
1 parent b1ef057 commit 9dee344
Show file tree
Hide file tree
Showing 28 changed files with 591 additions and 1,261 deletions.
9 changes: 5 additions & 4 deletions Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var autoprefixer = require('broccoli-autoprefixer');
var angularTemplates = require('broccoli-angular-templates-cache');
var AssetRev = require('broccoli-asset-rev');

var DEBUG = true;
var DEBUG = false;
var MODULE_NAME = 'prototypeAngularApp';

var app = 'app';
Expand Down Expand Up @@ -64,15 +64,16 @@ var styles = sass([app + '/styles'], 'app.scss', 'app.css', {
outputStyle: DEBUG ? 'expanded' : 'compressed',
});

if (!DEBUG) {
styles = autoprefixer(styles);
}

styles = concatenate(styles, {
inputFiles: ['**/*.css'],
outputFile: '/styles/app.css',
});

if (!DEBUG) {
styles = autoprefixer(styles);
}

var fonts = funnel(app, {
srcDir: 'fonts',
destDir: 'fonts',
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# QMK Cheatsheet #

Source code for the QMK Cheatsheet.
Source code for the unofficial QMK Cheatsheet.

Goals of this cheatsheet

- be helpful for 80% of the users
- brevity
- give consistent albeit opinionated examples

As some information may be incomplete, please submit pull requests.


## Things to do ##

- add styling
- make printable
- add more topics (below)

## Topics not (yet?) covered ##

- dynamic macros
- mouse keys
- custom functions
- leader key
- common config.h settings
Expand Down
12 changes: 8 additions & 4 deletions app/index.pug
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
doctype html
- var version = 0.2
html(lang="en")
head
title QMK Cheatsheet
title QMK Firmware Cheatsheet #{version}
script(src='bower/prism/prism.js')
script(src='bower/prism/components/prism-c.js')
link(rel='stylesheet', href='styles/vendor.css')
link(rel='stylesheet', href='styles/app.css')

body
h1 QMK Cheatsheet
main
include pages/layer
include pages/feature-overview
include pages/layers
include pages/modifiers
include pages/macros
include pages/dynamic-macros
include pages/tap-dance
include pages/mouse
include pages/leader
footer.
Version 0.1 by Jay Liu
Version #{version} by Jay Liu
#[a(href="https://github.com/jayliu50/qmk-cheatsheet/issues" target="_blank") Report Issues]
71 changes: 71 additions & 0 deletions app/pages/dynamic-macros.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
section
a(name="dynamic-macros")
h2 Dynamic Macros
a(href="https://docs.qmk.fm/dynamic_macros.html" target="_blank") Full Documentation

.intro
p Record and play keystrokes

.block
h3 Step 1: Setup

aside include this snippet in keymap.c
pre
code.language-c.
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
LOWER,
RAISE,
BACKLIT,
EXT_PLV,
DYNAMIC_MACRO_RANGE,
};

// this is called when dynamic macro buffer is full
void backlight_toggle(void) {
// INSERT CODE HERE: for example, call function to turn on indicator LED.
}

#include "dynamic_macro.h"`

.block
h3 Step 2: Use
aside in keymap.c, in your KEYMAP()

table
tr
td Keycode #[aside to be added to your call to KEYMAP()]
td Description
tr
td
pre
code.language-c.
DYN_REC_START1
td start recording the macro 1
tr
td
pre
code.language-c.
DYN_REC_START2
td start recording the macro 2
tr
td
pre
code.language-c.
DYN_MACRO_PLAY1
td replay the macro 1
tr
td
pre
code.language-c.
DYN_MACRO_PLAY2
td replay the macro 2
tr
td
pre
code.language-c.
DYN_REC_STOP
td finish the macro that is currently being recorded.
32 changes: 32 additions & 0 deletions app/pages/feature-overview.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
section.feature-overview
h1 QMK Firmware

ul.features
.feature
a(href="#layers")
span Up to 32 layers
aside Flexibly specify how to transition among layers.
.feature
a(href="#modifiers")
span Modifiers
aside Re-assign and combine modifiers; combine modifier and keycode into a single key.
.feature
a(href="#macros")
span Macros
aside Pack entire sequences of key strokes into one.
.feature
a(href="#dynamic-macros")
span Dynamic Macros
aside Record and play back keystrokes on the fly.
.feature
a(href="#tap-dance")
span Tap Dance
aside The number of times a key is tapped determines the keycode or action.
.feature
a(href="#leader")
span Leader Key
aside Send keycode or perform action based on sequence of keys pressed.
.feature
a(href="#mouse")
span Mouse Keys
aside Control mouse and its buttons.
28 changes: 16 additions & 12 deletions app/pages/layer.pug → app/pages/layers.pug
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
section
a(name="layers")
h2 Setting up a layer
a(href="https://docs.qmk.fm/key_functions.html" target="_blank") Documentation
a(href="https://docs.qmk.fm/key_functions.html" target="_blank") Full Documentation

.block
h3 Step 1: Declare

p Create each layer as an entry in an enum. YOUR_LAYER_1 and YOUR_LAYER_2, below, should be replaced with the names of your layers.
p Create each layer as an entry in an enum. Replace YOUR_LAYER_1, YOUR_LAYER_2, etc., below, with names of your layers.
aside in keymap.c
pre
code.language-c.
// Layer definitions
// Layer Declarations
enum {
YOUR_LAYER_1 = 0,
YOUR_LAYER_2,
Expand All @@ -18,10 +19,12 @@ section
.block
h3 Step 2: Define

p Add the keycodes for each layer into the keymaps array. YOUR_LAYER_1 and YOUR_LAYER_2, below, should be replaced with the names of your layers.
aside in keymap.c
p Add the keycodes for each layer into the keymaps array, by calling KEYMAP() for each layer.
aside in keymap.c, in the keymaps array
pre
code.language-c.

// Layer Definitions
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[YOUR_LAYER_1] = KEYMAP(
Expand All @@ -34,16 +37,17 @@ section

// ..., the rest of your layers

}; // end of keymap definitions
};
.block
h3 Step 3: Use, with Layer-switching Functions
h3 Step 3: Use

p Here are the functions you call to actually switch to layers.
p Here are a variety of ways to change the layer.

table
thead
td Keycode #[aside to be added to KEYMAP]
td Description
tr
td Keycode #[aside to be added to your call to KEYMAP()]
td Description
tr
td
pre
Expand All @@ -55,13 +59,13 @@ section
pre
code.language-c.
LT(YOUR_LAYER, KC_XXXX)
td When held: go to YOUR_LAYER. #[br] When tapped: send KC_XXXX
td Layer Tap. When held: go to YOUR_LAYER. #[br] When tapped: send KC_XXXX
tr
td
pre
code.language-c.
TG(YOUR_LAYER)
td When tapped, toggles YOUR_LAYER on or off
td Layer Toggle. When tapped, toggles YOUR_LAYER on or off
tr
td
pre
Expand Down
7 changes: 7 additions & 0 deletions app/pages/leader.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
section
a(name="leader")
h2 Leader
a(href="https://docs.qmk.fm/leader_key.html" target="_blank") Full Documentation

.intro
p Coming soon
12 changes: 7 additions & 5 deletions app/pages/macros.pug
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
section
a(name="macros")
h2 Macros
a(href="https://docs.qmk.fm/macros.html" target="_blank") Documentation
a(href="https://docs.qmk.fm/macros.html" target="_blank") Full Documentation

.block
h3 Step 1: Declare

p Create an entry for each macro in an enum. YOUR_MACRO_1 and YOUR_MACRO_2, below, should be replaced with the names of your macros.
p Create an entry for each macro in an enum. Replace YOUR_MACRO_1, YOUR_MACRO_2, etc., below, with the names of your macros.

aside in keymap.c, above KEYMAP()
pre
code.language-c.
// Macro definitions
// Macro Declarations
enum {
YOUR_MACRO_1 = 0,
YOUR_MACRO_2,
Expand All @@ -21,6 +22,7 @@ section
aside in keymap.c, above KEYMAP()
pre
code.language-c.
// Macro Definitions
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
Expand All @@ -33,7 +35,7 @@ section
}
}

// for more complex macros
// for more complex macros (want to add modifiers, etc.)
case YOUR_MACRO_1: {
if (recond->event.pressed) {
return MACRO(
Expand All @@ -49,7 +51,7 @@ section
};
.block
h3 Step 3: Use
aside in keymap.c, in your KEYMAP()
aside in keymap.c, in your call to KEYMAP()
pre
code.language-c.
M(YOUR_MACRO_1)
Loading

0 comments on commit 9dee344

Please sign in to comment.