From 8a709c2750eab09ec0f83450410a13640931d48e Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 16 Dec 2012 02:32:07 +0900 Subject: Add initial fix for new keymap. --- common/keymap.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index 7dfd6c2a1b..935d886d77 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -20,15 +20,21 @@ along with this program. If not, see . #include #include +#include "action.h" - -/* keycode in specific layer */ +/* + * legacy keymap interface: keycode + */ uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col); - /* layer to move during press Fn key */ uint8_t keymap_fn_layer(uint8_t fn_bits); - /* keycode to send when release Fn key without using */ uint8_t keymap_fn_keycode(uint8_t fn_bits); +/* + * new keymap interface: action + */ +action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); +uint8_t keymap_process_event(keyevent_t event); + #endif -- cgit v1.2.3 From 411de9cc22e927313a5a768f3bf41f2f99bca126 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 9 Jan 2013 22:33:33 +0900 Subject: Add new layer actions. --- common/keymap.h | 1 - 1 file changed, 1 deletion(-) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index 935d886d77..f992be18e8 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -35,6 +35,5 @@ uint8_t keymap_fn_keycode(uint8_t fn_bits); * new keymap interface: action */ action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); -uint8_t keymap_process_event(keyevent_t event); #endif -- cgit v1.2.3 From 1e3e41a2c9ed8b2f7d44be0aed5d96ed557fa13d Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 28 Jan 2013 14:06:42 +0900 Subject: Clean code. --- common/keymap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index f992be18e8..f54fea90d2 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -22,6 +22,12 @@ along with this program. If not, see . #include #include "action.h" + +/* layer used currently */ +extern uint8_t current_layer; +/* layer to return or start with */ +extern uint8_t default_layer; + /* * legacy keymap interface: keycode */ -- cgit v1.2.3 From d95463f2e0369dc0e28497bb923b3012fb09e900 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 31 Jan 2013 17:50:53 +0900 Subject: Add legacy keymap support. --- common/keymap.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index f54fea90d2..7487615518 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -28,18 +28,22 @@ extern uint8_t current_layer; /* layer to return or start with */ extern uint8_t default_layer; + /* - * legacy keymap interface: keycode + * new keymap interface: action */ +action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); + + +#ifndef NO_LEGACY_KEYMAP_SUPPORT +/* keycode of key */ uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col); + /* layer to move during press Fn key */ uint8_t keymap_fn_layer(uint8_t fn_bits); + /* keycode to send when release Fn key without using */ uint8_t keymap_fn_keycode(uint8_t fn_bits); - -/* - * new keymap interface: action - */ -action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); +#endif #endif -- cgit v1.2.3 From 1d7962ba8a20323dc13cc913381608e117afaeb4 Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 1 Feb 2013 14:48:11 +0900 Subject: Add user defined function to action. --- common/keymap.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index 7487615518..e0fafeaf25 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -29,11 +29,13 @@ extern uint8_t current_layer; extern uint8_t default_layer; -/* - * new keymap interface: action - */ +/* action for key */ +// TODO: should use struct key_t? action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); +/* user defined special function */ +void keymap_call_function(keyrecord_t *record, uint8_t id); + #ifndef NO_LEGACY_KEYMAP_SUPPORT /* keycode of key */ -- cgit v1.2.3 From aad91a30a34d61739e1261bb82a1cb1ace581afa Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 4 Feb 2013 22:53:45 +0900 Subject: Add macro feature. --- common/keymap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/keymap.h') diff --git a/common/keymap.h b/common/keymap.h index e0fafeaf25..30d73f797f 100644 --- a/common/keymap.h +++ b/common/keymap.h @@ -23,6 +23,7 @@ along with this program. If not, see . #include "action.h" +// TODO: move to action.h? /* layer used currently */ extern uint8_t current_layer; /* layer to return or start with */ @@ -34,7 +35,7 @@ extern uint8_t default_layer; action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col); /* user defined special function */ -void keymap_call_function(keyrecord_t *record, uint8_t id); +void keymap_call_function(keyrecord_t *record, uint8_t id, uint8_t opt); #ifndef NO_LEGACY_KEYMAP_SUPPORT -- cgit v1.2.3