aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard/gh60
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-31 22:47:19 +0900
committertmk <nobody@nowhere>2013-03-31 22:47:19 +0900
commit10f33a3e484e24065ed5eaab1c56c35156bace89 (patch)
tree8b938962644ad2d04261655bc9487984e86e4996 /keyboard/gh60
parent353a9b56e6caee853d3f808d2bfedf07056b4518 (diff)
downloadfirmware-10f33a3e484e24065ed5eaab1c56c35156bace89.tar.gz
firmware-10f33a3e484e24065ed5eaab1c56c35156bace89.tar.bz2
firmware-10f33a3e484e24065ed5eaab1c56c35156bace89.zip
Remove ACT_KEYMAP and ACT_OVERLAY
- Remove ACT_OVERLAY - Rename ACT_KEYMAP to ACT_LAYER - Add ACT_LAYER_BITOP
Diffstat (limited to 'keyboard/gh60')
-rw-r--r--keyboard/gh60/config.h3
-rw-r--r--keyboard/gh60/keymap.c44
2 files changed, 15 insertions, 32 deletions
diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h
index fbe587081..567b126b6 100644
--- a/keyboard/gh60/config.h
+++ b/keyboard/gh60/config.h
@@ -61,8 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_PRINT
/* disable action features */
-//#define NO_ACTION_KEYMAP
-//#define NO_ACTION_OVERLAY
+//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
diff --git a/keyboard/gh60/keymap.c b/keyboard/gh60/keymap.c
index d6af16961..2f41ad4fd 100644
--- a/keyboard/gh60/keymap.c
+++ b/keyboard/gh60/keymap.c
@@ -91,7 +91,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
LCTL,A, S, D, F, G, H, J, K, L, FN2, QUOT, ENT, \
- LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, RSFT, \
+ LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, FN9, \
LCTL,LGUI,LALT, SPC, RALT,FN3, FN3, FN0),
/* Keymap 1: colemak */
KEYMAP_ANSI(
@@ -198,54 +198,38 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
};
-static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
-
/*
* Fn action definition
*/
static const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_KEYMAP_MOMENTARY(4),
- [1] = ACTION_KEYMAP_TAP_KEY(5, KC_SLASH),
- [2] = ACTION_KEYMAP_TAP_KEY(6, KC_SCLN),
- [3] = ACTION_KEYMAP_MOMENTARY(6),
- [4] = ACTION_KEYMAP_MOMENTARY(7), // to Layout selector
+ [0] = ACTION_LAYER_MOMENTARY(4),
+ [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH),
+ [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN),
+ [3] = ACTION_LAYER_MOMENTARY(6),
+ [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector
[5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout
[6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout
[7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout
[8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout
+ [9] = ACTION_RMOD_TAP_KEY(KC_RSFT, KC_GRV),
};
#endif
#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
-#define OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
{
- /* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */
- if (layer & OVERLAY_BIT) {
- layer &= OVERLAY_MASK;
- if (layer < OVERLAYS_SIZE) {
- return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
- } else {
- // XXX: this may cuaes bootlaoder_jump incositent fail.
- //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
- return KC_TRANSPARENT;
- }
- }
- /* Keymap: 0-15 */
- else {
- if (layer < KEYMAPS_SIZE) {
- return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
- } else {
- // XXX: this may cuaes bootlaoder_jump incositent fail.
- //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
- // fall back to layer 0
- return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
- }
+ if (layer < KEYMAPS_SIZE) {
+ return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
+ } else {
+ // XXX: this may cuaes bootlaoder_jump inconsistent fail.
+ //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
+ // fall back to layer 0
+ return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}