Browse Source

update for action_t

master
di0ib 7 years ago
parent
commit
91dbfbbeb1

+ 0
- 13
keyboard/i75_TeensyLC/keymap_common.c View File

along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keymap_common.h" #include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
keyboard/i75_TeensyLC/keymap_common.h View File

#include "debug.h" #include "debug.h"
#include "keymap.h" #include "keymap.h"



extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];


/* i75 keymap definition macro /* i75 keymap definition macro
*/ */
#define KEYMAP( \ #define KEYMAP( \

+ 0
- 4
keyboard/i75_TeensyLC/keymap_i75.c View File

const action_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

}

+ 0
- 13
keyboard/stm32_f103_planck/keymap_common.c View File

along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keymap_common.h" #include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
keyboard/stm32_f103_planck/keymap_common.h View File

#include "debug.h" #include "debug.h"
#include "keymap.h" #include "keymap.h"



extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];


/* TV44 keymap definition macro /* TV44 keymap definition macro
*/ */
#define KEYMAP( \ #define KEYMAP( \

+ 1
- 1
keyboard/stm32_f103_planck/keymap_planck.c View File

TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP, END), TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP, END),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(3, KC_TAB), [0] = ACTION_LAYER_TAP_KEY(3, KC_TAB),
[1] = ACTION_LAYER_TAP_KEY(1, KC_SPC), [1] = ACTION_LAYER_TAP_KEY(1, KC_SPC),
[2] = ACTION_LAYER_TAP_KEY(2, KC_SPC), [2] = ACTION_LAYER_TAP_KEY(2, KC_SPC),

+ 0
- 13
keyboard/teensy_lc_planck/keymap_common.c View File

along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keymap_common.h" #include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 1
- 1
keyboard/teensy_lc_planck/keymap_planck.c View File

TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP, END), TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP, END),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(3, KC_TAB), [0] = ACTION_LAYER_TAP_KEY(3, KC_TAB),
[1] = ACTION_LAYER_TAP_KEY(1, KC_SPC), [1] = ACTION_LAYER_TAP_KEY(1, KC_SPC),
[2] = ACTION_LAYER_TAP_KEY(2, KC_SPC), [2] = ACTION_LAYER_TAP_KEY(2, KC_SPC),

+ 0
- 13
keyboard/teensy_lc_tv44/keymap_common.c View File

along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keymap_common.h" #include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
keyboard/teensy_lc_tv44/keymap_common.h View File

#include "debug.h" #include "debug.h"
#include "keymap.h" #include "keymap.h"



extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];


/* TV44 keymap definition macro /* TV44 keymap definition macro
*/ */
#define KEYMAP( \ #define KEYMAP( \

+ 1
- 1
keyboard/teensy_lc_tv44/keymap_tv44.c View File

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[] = {
[0] = ACTION_LAYER_TAP_KEY(3, KC_TAB), [0] = ACTION_LAYER_TAP_KEY(3, KC_TAB),
[1] = ACTION_LAYER_TAP_KEY(1, KC_SPC), [1] = ACTION_LAYER_TAP_KEY(1, KC_SPC),
[2] = ACTION_LAYER_TAP_KEY(2, KC_SPC), [2] = ACTION_LAYER_TAP_KEY(2, KC_SPC),

Loading…
Cancel
Save