1
0

Merge branch 'actionmap_fix' into develop

This commit is contained in:
tmk 2016-06-26 01:30:05 +09:00
commit 25e05c6cf9
79 changed files with 105 additions and 106 deletions

View File

@ -12,5 +12,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* Common layout: ANSI+ISO /* Common layout: ANSI+ISO

View File

@ -53,6 +53,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), [0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS),
}; };

View File

@ -12,5 +12,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -11,7 +11,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -45,6 +45,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* 107-key */ /* 107-key */

View File

@ -60,7 +60,7 @@ enum macro_id {
ALT_TAB, ALT_TAB,
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN), [1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH), [2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH),

View File

@ -45,6 +45,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* Common layout for M0110 and M0110A /* Common layout for M0110 and M0110A

View File

@ -98,9 +98,9 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),

View File

@ -79,7 +79,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), [1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE), [2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE),

View File

@ -68,6 +68,6 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -65,7 +65,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "keycode.h" #include "keycode.h"
// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1), // FN0 - left command key ACTION_LAYER_MOMENTARY(1), // FN0 - left command key
ACTION_LAYER_MOMENTARY(1), // FN1 - right command key ACTION_LAYER_MOMENTARY(1), // FN1 - right command key
ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash

View File

@ -163,7 +163,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
/* /*
* Fn actions * Fn actions
*/ */
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_TAP_TOGGLE(0), // FN0 ACTION_LAYER_TAP_TOGGLE(0), // FN0
ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1
ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* All keys */ /* All keys */

View File

@ -30,5 +30,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -28,5 +28,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -54,7 +54,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -119,4 +119,4 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
#endif #endif
}; };
const uint16_t fn_actions[] PROGMEM = {}; const action_t fn_actions[] PROGMEM = {};

View File

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* ,---------------. ,---------------. ,---------------. /* ,---------------. ,---------------. ,---------------.

View File

@ -52,7 +52,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".key
), ),
}; };
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_LAYER_MOMENTARY(3), [2] = ACTION_LAYER_MOMENTARY(3),

View File

@ -142,9 +142,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used)
[1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps)

View File

@ -32,5 +32,5 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
}; };

View File

@ -32,5 +32,5 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
}; };

View File

@ -58,7 +58,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -37,7 +37,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
} }
const uint16_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = { const action_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default Layer /* Default Layer
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |

View File

@ -10,7 +10,7 @@
#define AC_LM1 ACTION_LAYER_MOMENTARY(1) // HHKB layer #define AC_LM1 ACTION_LAYER_MOMENTARY(1) // HHKB layer
const uint16_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = { const action_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default Layer /* Default Layer
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BSpc | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BSpc |

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* Alps64 keymap definition macro */ /* Alps64 keymap definition macro */

View File

@ -27,9 +27,9 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
}; };
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),

View File

@ -121,7 +121,7 @@ enum macro_id {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), // HHKB layer [0] = ACTION_LAYER_MOMENTARY(1), // HHKB layer
[1] = ACTION_LAYER_TAP_KEY(1, KC_ENTER), // HHKB layer [1] = ACTION_LAYER_TAP_KEY(1, KC_ENTER), // HHKB layer
[2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash*

View File

@ -28,6 +28,6 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
}; };
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* GH60 keymap definition macro /* GH60 keymap definition macro

View File

@ -131,7 +131,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(4), [0] = ACTION_LAYER_MOMENTARY(4),
[1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH), [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH),
[2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN), [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN),

View File

@ -47,6 +47,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -8,4 +8,4 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, \ LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL), LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL),
}; };
const uint16_t PROGMEM fn_actions[] = {}; const action_t PROGMEM fn_actions[] = {};

View File

@ -90,7 +90,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS,FN6, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,FN6, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
/* Poker Layout */ /* Poker Layout */
[0] = ACTION_LAYER_MOMENTARY(6), // to Fn overlay [0] = ACTION_LAYER_MOMENTARY(6), // to Fn overlay
[1] = ACTION_LAYER_TOGGLE(4), // toggle arrow overlay [1] = ACTION_LAYER_TOGGLE(4), // toggle arrow overlay

View File

@ -40,7 +40,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT), TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
/* Poker Layout */ /* Poker Layout */
[0] = ACTION_LAYER_BIT_XOR(1, 0b0101, ON_BOTH), // Poker Fn(with fix for Esc) [0] = ACTION_LAYER_BIT_XOR(1, 0b0101, ON_BOTH), // Poker Fn(with fix for Esc)
[1] = ACTION_LAYER_TOGGLE(5), // Poker Arrow toggle [1] = ACTION_LAYER_TOGGLE(5), // Poker Arrow toggle

View File

@ -65,7 +65,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
/* Poker Layout */ /* Poker Layout */
[0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press
[1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press

View File

@ -49,7 +49,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
#define KEYMAP( \ #define KEYMAP( \

View File

@ -192,9 +192,9 @@ enum macro_id {
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used)
[1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps)

View File

@ -54,7 +54,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_LAYER_MOMENTARY(3), [2] = ACTION_LAYER_MOMENTARY(3),
@ -89,7 +89,7 @@ const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
[31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH), [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
}; };
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };
#endif #endif

View File

@ -42,9 +42,9 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -108,7 +108,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), [1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE),
[2] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [2] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde

View File

@ -42,7 +42,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
#ifdef INFINITY_PROTOTYPE #ifdef INFINITY_PROTOTYPE

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
#ifdef INFINITY_PROTOTYPE #ifdef INFINITY_PROTOTYPE

View File

@ -119,7 +119,7 @@ enum macro_id {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] = { const action_t fn_actions[] = {
[0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used)
[1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps)
[2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash*

View File

@ -42,7 +42,7 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
}; };
const uint16_t fn_actions[] = { const action_t fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -34,7 +34,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
}; };
@ -60,7 +60,7 @@ action_t keymap_fn_to_action(uint8_t keycode)
if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
} else { } else {
action.code = ACTION_NO; action = (action_t)ACTION_NO;
} }
return action; return action;
} }

View File

@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
#include "action_code.h"
#include "report.h" #include "report.h"
#include "host.h" #include "host.h"
#include "print.h" #include "print.h"
@ -28,7 +29,7 @@ static const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
}; };
static const uint16_t fn_actions[] = { static const action_t fn_actions[] = {
}; };
/* translates key to keycode */ /* translates key to keycode */
@ -40,5 +41,5 @@ uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
/* translates Fn keycode to action */ /* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode) action_t keymap_fn_to_action(uint8_t keycode)
{ {
return (action_t){ .code = fn_actions[FN_INDEX(keycode)] }; return (action_t)fn_actions[FN_INDEX(keycode)];
} }

View File

@ -28,7 +28,7 @@ static const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
}; };
static const uint16_t fn_actions[] = { static const action_t fn_actions[] = {
}; };
/* translates key to keycode */ /* translates key to keycode */

View File

@ -28,7 +28,7 @@ static const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{{KC_A}}, {{KC_A}},
}; // to test: KC_CAPS, KT_BTLD, KC_A }; // to test: KC_CAPS, KT_BTLD, KC_A
static const uint16_t fn_actions[] = { static const action_t fn_actions[] = {
}; };
/* translates key to keycode */ /* translates key to keycode */

View File

@ -18,6 +18,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_COLS][MATRIX_ROWS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -56,6 +56,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed [1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed
}; };

View File

@ -29,4 +29,4 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
static const uint16_t PROGMEM fn_actions[] = {}; static const action_t PROGMEM fn_actions[] = {};

View File

@ -59,6 +59,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed [1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed
}; };

View File

@ -29,4 +29,4 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
static const uint16_t PROGMEM fn_actions[] = {}; static const action_t PROGMEM fn_actions[] = {};

View File

@ -18,6 +18,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_COLS][MATRIX_ROWS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -17,7 +17,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_BACKLIGHT_STEP() [1] = ACTION_BACKLIGHT_STEP()
}; };

View File

@ -17,7 +17,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_BACKLIGHT_STEP() [1] = ACTION_BACKLIGHT_STEP()
}; };

View File

@ -17,7 +17,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
FN7, NO, MSTP) FN7, NO, MSTP)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_FN1), [1] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_FN1),
[2] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_FN2), [2] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_FN2),

View File

@ -17,7 +17,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS, TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS, TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_BACKLIGHT_TOGGLE(), [1] = ACTION_BACKLIGHT_TOGGLE(),
[2] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_ALPHA), [2] = ACTION_BACKLIGHT_LEVEL(BACKLIGHT_ALPHA),

View File

@ -22,7 +22,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LEFT,DOWN,RGHT, TRNS, TRNS,TRNS,TRNS) LEFT,DOWN,RGHT, TRNS, TRNS,TRNS,TRNS)
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(2), [0] = ACTION_LAYER_MOMENTARY(2),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), [1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE),
[2] = ACTION_LAYER_TOGGLE(1), [2] = ACTION_LAYER_TOGGLE(1),

View File

@ -25,7 +25,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(2), [0] = ACTION_LAYER_MOMENTARY(2),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), [1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE),
[2] = ACTION_LAYER_TOGGLE(1), [2] = ACTION_LAYER_TOGGLE(1),

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keymap.h" #include "keymap.h"
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
#define KEYMAP( \ #define KEYMAP( \
K08, K09, K18, K19, K28, K29, K38, K39, K48, K49, K58, K59, K68, K69, K88, K89, \ K08, K09, K18, K19, K28, K29, K38, K39, K48, K49, K58, K59, K68, K69, K88, K89, \

View File

@ -35,7 +35,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_9), [1] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
[2] = ACTION_MODS_KEY(MOD_LSFT, KC_0) [2] = ACTION_MODS_KEY(MOD_LSFT, KC_0)

View File

@ -17,6 +17,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -17,6 +17,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS, TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -17,6 +17,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -17,6 +17,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS)
}; };
static const uint16_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1) [0] = ACTION_LAYER_MOMENTARY(1)
}; };

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const action_t fn_actions[];
/* All keys */ /* All keys */

View File

@ -177,7 +177,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
static const uint16_t fn_actions[] PROGMEM = { static const action_t fn_actions[] PROGMEM = {
[0] = ACTION_DEFAULT_LAYER_SET(0), [0] = ACTION_DEFAULT_LAYER_SET(0),
[1] = ACTION_LAYER_MOMENTARY(1), [1] = ACTION_LAYER_MOMENTARY(1),
[2] = ACTION_LAYER_MOMENTARY(2), //ACTION_LAYER_ON(2, ON_RELEASE), [2] = ACTION_LAYER_MOMENTARY(2), //ACTION_LAYER_ON(2, ON_RELEASE),

View File

@ -181,9 +181,9 @@ typedef union {
/* action utility */ /* action utility */
#define ACTION_NO 0 #define ACTION_NO { .code = 0 }
#define ACTION_TRANSPARENT 1 #define ACTION_TRANSPARENT { .code = 1 }
#define ACTION(kind, param) ((kind)<<12 | (param)) #define ACTION(kind, param) { .code = ((kind)<<12 | (param)) }
/* /*

View File

@ -117,7 +117,7 @@ void layer_debug(void)
action_t layer_switch_get_action(keypos_t key) action_t layer_switch_get_action(keypos_t key)
{ {
action_t action = { .code = ACTION_TRANSPARENT }; action_t action = ACTION_TRANSPARENT;
#ifndef NO_ACTION_LAYER #ifndef NO_ACTION_LAYER
uint32_t layers = layer_state | default_layer_state; uint32_t layers = layer_state | default_layer_state;
@ -125,7 +125,7 @@ action_t layer_switch_get_action(keypos_t key)
for (int8_t i = 31; i >= 0; i--) { for (int8_t i = 31; i >= 0; i--) {
if (layers & (1UL<<i)) { if (layers & (1UL<<i)) {
action = action_for_key(i, key); action = action_for_key(i, key);
if (action.code != ACTION_TRANSPARENT) { if (action.code != (action_t)ACTION_TRANSPARENT.code) {
return action; return action;
} }
} }

View File

@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Keymapping with 16bit action codes */ /* Keymapping with 16bit action codes */
extern const uint16_t actionmaps[][MATRIX_ROWS][MATRIX_COLS]; extern const action_t actionmaps[][MATRIX_ROWS][MATRIX_COLS];
/* Modified key */ /* Modified key */

View File

@ -53,7 +53,7 @@ action_t action_for_key(uint8_t layer, keypos_t key)
case KC_LALT: case KC_LALT:
if (keymap_config.swap_lalt_lgui) { if (keymap_config.swap_lalt_lgui) {
if (keymap_config.no_gui) { if (keymap_config.no_gui) {
return keycode_to_action(ACTION_NO); return keycode_to_action(KC_NO);
} }
return keycode_to_action(KC_LGUI); return keycode_to_action(KC_LGUI);
} }
@ -63,13 +63,13 @@ action_t action_for_key(uint8_t layer, keypos_t key)
return keycode_to_action(KC_LALT); return keycode_to_action(KC_LALT);
} }
if (keymap_config.no_gui) { if (keymap_config.no_gui) {
return keycode_to_action(ACTION_NO); return keycode_to_action(KC_NO);
} }
return keycode_to_action(KC_LGUI); return keycode_to_action(KC_LGUI);
case KC_RALT: case KC_RALT:
if (keymap_config.swap_ralt_rgui) { if (keymap_config.swap_ralt_rgui) {
if (keymap_config.no_gui) { if (keymap_config.no_gui) {
return keycode_to_action(ACTION_NO); return keycode_to_action(KC_NO);
} }
return keycode_to_action(KC_RGUI); return keycode_to_action(KC_RGUI);
} }
@ -79,7 +79,7 @@ action_t action_for_key(uint8_t layer, keypos_t key)
return keycode_to_action(KC_RALT); return keycode_to_action(KC_RALT);
} }
if (keymap_config.no_gui) { if (keymap_config.no_gui) {
return keycode_to_action(ACTION_NO); return keycode_to_action(KC_NO);
} }
return keycode_to_action(KC_RGUI); return keycode_to_action(KC_RGUI);
case KC_GRAVE: case KC_GRAVE:
@ -133,23 +133,22 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
/* translates keycode to action */ /* translates keycode to action */
static action_t keycode_to_action(uint8_t keycode) static action_t keycode_to_action(uint8_t keycode)
{ {
action_t action = {};
switch (keycode) { switch (keycode) {
case KC_A ... KC_EXSEL: case KC_A ... KC_EXSEL:
case KC_LCTRL ... KC_RGUI: case KC_LCTRL ... KC_RGUI:
action.code = ACTION_KEY(keycode); return (action_t)ACTION_KEY(keycode);
break; break;
case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE:
action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); return (action_t)ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode));
break; break;
case KC_AUDIO_MUTE ... KC_WWW_FAVORITES: case KC_AUDIO_MUTE ... KC_WWW_FAVORITES:
action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); return (action_t)ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode));
break; break;
case KC_MS_UP ... KC_MS_ACCEL2: case KC_MS_UP ... KC_MS_ACCEL2:
action.code = ACTION_MOUSEKEY(keycode); return (action_t)ACTION_MOUSEKEY(keycode);
break; break;
case KC_TRNS: case KC_TRNS:
action.code = ACTION_TRANSPARENT; return (action_t)ACTION_TRANSPARENT;
break; break;
case KC_BOOTLOADER: case KC_BOOTLOADER:
clear_keyboard(); clear_keyboard();
@ -157,10 +156,10 @@ static action_t keycode_to_action(uint8_t keycode)
bootloader_jump(); // not return bootloader_jump(); // not return
break; break;
default: default:
action.code = ACTION_NO; return (action_t)ACTION_NO;
break; break;
} }
return action; return (action_t)ACTION_NO;
} }
@ -181,21 +180,20 @@ uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
__attribute__ ((weak)) __attribute__ ((weak))
action_t keymap_fn_to_action(uint8_t keycode) action_t keymap_fn_to_action(uint8_t keycode)
{ {
action_t action = { .code = ACTION_NO };
switch (keycode) { switch (keycode) {
case KC_FN0 ... KC_FN31: case KC_FN0 ... KC_FN31:
{ {
uint8_t layer = keymap_fn_layer(FN_INDEX(keycode)); uint8_t layer = keymap_fn_layer(FN_INDEX(keycode));
uint8_t key = keymap_fn_keycode(FN_INDEX(keycode)); uint8_t key = keymap_fn_keycode(FN_INDEX(keycode));
if (key) { if (key) {
action.code = ACTION_LAYER_TAP_KEY(layer, key); return (action_t)ACTION_LAYER_TAP_KEY(layer, key);
} else { } else {
action.code = ACTION_LAYER_MOMENTARY(layer); return (action_t)ACTION_LAYER_MOMENTARY(layer);
} }
} }
return action; return (action_t)ACTION_NO;
default: default:
return action; return (action_t)ACTION_NO;
} }
} }
#endif #endif