keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) \
)
-/* legacy keymap support */
-#define USE_LEGACY_KEYMAP
-
/* USART configuration
* asynchronous, 2400baud, 8-data bit, non parity, 1-stop bit, no flow control
#include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h"
+#include "action.h"
#include "util.h"
#include "keymap.h"
}
-// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
-static const uint8_t PROGMEM fn_layer[] = {
- 0, // Fn0
- 0, // Fn1
- 0, // Fn2
- 0, // Fn3
- 0, // Fn4
- 0, // Fn5
- 0, // Fn6
- 0 // Fn7
+static const uint16_t fn_actions[] PROGMEM = {
};
-// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
-// See layer.c for details.
-static const uint8_t PROGMEM fn_keycode[] = {
- KC_NO, // Fn0
- KC_NO, // Fn1
- KC_NO, // Fn2
- KC_NO, // Fn3
- KC_NO, // Fn4
- KC_NO, // Fn5
- KC_NO, // Fn6
- KC_NO // Fn7
-};
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+}
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
-uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
-{
- return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
-}
-
-uint8_t keymap_fn_layer(uint8_t index)
+/* translates key to keycode */
+uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
- return pgm_read_byte(&fn_layer[index]);
+ return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}
-uint8_t keymap_fn_keycode(uint8_t index)
+/* translates Fn keycode to action */
+action_t keymap_fn_to_action(uint8_t keycode)
{
- return pgm_read_byte(&fn_keycode[index]);
+ return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}