yes, typing "album" is a problem, typing fast gets many problems
so I switched to using TAB key instead and it works well
here is my code:
...
#include "action_layer.h" //for layer_on functions
...
KEYMAP(
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR,SLCK,BRK,
TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TRNS, TRNS,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,F4,TRNS, TRNS, TRNS, TRNS, TRNS, DEL, END, PGDN, P7, P8, P9,
TRNS,TRNS, LEFT,DOWN,RGHT,TRNS, LEFT,DOWN,UP, TAB,TRNS, TRNS, TRNS, P4, P5, P6, PPLS,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, UP, P1, P2, P3,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
...
enum function_id {
LALT_TAB,
...
[6] = ACTION_FUNCTION_TAP(LALT_TAB), //
...
/*
* user defined action function
* copied from /keyboard/hhkb/keymap_hasu.c
*/
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
/* if (record->event.pressed) dprint("P"); else dprint("R"); */
/* dprintf("%d", record->tap.count); */
/* if (record->tap.interrupted) dprint("i"); */
/* dprint("\n"); */
switch (id) {
case LALT_TAB:
if (record->event.pressed) {
if (record->tap.count > 0 && !record->tap.interrupted) {
if (record->tap.interrupted) { //strange that it would get here
//dprint("tap interrupted\n");
layer_on(2);
register_mods(MOD_BIT(KC_LALT));
//optimization for alt tab
register_code(KC_TAB);
unregister_code(KC_TAB);
}
} else {
layer_on(2);
register_mods(MOD_BIT(KC_LALT));
//optimization for alt tab
register_code(KC_TAB);
unregister_code(KC_TAB);
}
} else {
if (record->tap.count > 0 && !(record->tap.interrupted)) {
/* add_weak_mods(MOD_BIT(KC_LSHIFT)); */
/* send_keyboard_report(); */
register_code(KC_TAB);
unregister_code(KC_TAB);
/* del_weak_mods(MOD_BIT(KC_LSHIFT)); */
/* send_keyboard_report(); */
record->tap.count = 0; // ad hoc: cancel tap
} else {
unregister_mods(MOD_BIT(KC_LALT));
layer_off(2);
}
}
break;