+#include "keymap_passwords.h"
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
+ if (record->event.pressed) {
+ switch (id) {
+ case XMONAD_RESET: return MACRO_XMONAD_RESET;
+ case PASSWORD1: return MACRO_PASSWORD1;
+ }
+ }
+ return MACRO_NONE;
+}
+
+#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
+#define FN_ACTIONS_7_SIZE (sizeof(fn_actions_7) / sizeof(fn_actions_7[0]))
+
+/*
+ * translates Fn keycode to action
+ * for some layers, use different translation table
+ */
+action_t keymap_fn_to_action(uint8_t keycode)
+{
+ uint8_t layer = biton32(layer_state);
+
+ action_t action;
+ action.code = ACTION_NO;
+
+ if (layer == 7 && FN_INDEX(keycode) < FN_ACTIONS_7_SIZE) {
+ action.code = pgm_read_word(&fn_actions_7[FN_INDEX(keycode)]);
+ }
+
+ // by default, use fn_actions from default layer 0
+ // this is needed to get mapping for same key, that was used switch to some layer,
+ // to have possibility to switch layers back
+ if (action.code == ACTION_NO && FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
+ action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
+ }
+
+ return action;
+}
+