forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config.h and rules.mk support for data driven keymaps (qmk#12859)
* Add config.h and rules.mk support for data driven keymaps * tidy up after rebase * Rename key as it can contain more than just keyboard overrides * tidy up after rebase * Add validation
- Loading branch information
Showing
10 changed files
with
101 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
# Look for a json keymap file | ||
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","") | ||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c | ||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json | ||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) | ||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","") | ||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c | ||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json | ||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) | ||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","") | ||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c | ||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json | ||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) | ||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","") | ||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c | ||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json | ||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) | ||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","") | ||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c | ||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json | ||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) | ||
endif | ||
|
||
# Load the keymap-level rules.mk if exists | ||
ifneq ("$(wildcard $(KEYMAP_PATH))", "") | ||
-include $(KEYMAP_PATH)/rules.mk | ||
endif | ||
|
||
# Generate the keymap.c | ||
$(KEYMAP_C): $(KEYMAP_JSON) | ||
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "qmk.keymap.v1", | ||
"title": "Keymap Information", | ||
"type": "object", | ||
"properties": { | ||
"author": {"$ref": "qmk.definitions.v1#/text_identifier"}, | ||
"keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"}, | ||
"keymap": {"$ref": "qmk.definitions.v1#/text_identifier"}, | ||
"layout": {"$ref": "qmk.definitions.v1#/layout_macro"}, | ||
"layers": { | ||
"type": "array", | ||
"items": { | ||
"type": "array", | ||
"items": {"type": "string"} | ||
} | ||
}, | ||
"config": {"$ref": "qmk.keyboard.v1"}, | ||
"notes": { | ||
"type": "string", | ||
"description": "asdf" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters