at this point unfortunately you have to write code and compile it. the code should remove LCTL before send ESC and restore the modifier state at the end. not easy but still possible.
I have a plan to add action just like ACTION_MODS_KEY except for removing modifier instead of adding.
I got it to work with:
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id) {
case ESCX:
if (record->event.pressed) {
unregister_mods(MOD_BIT(KC_LCTL));
register_code(KC_ESC);
unregister_code(KC_ESC);
register_mods(MOD_BIT(KC_LCTL));
send_keyboard_report();
}
break;
}
}
copying stuff from hhkb/unimap_hasu.c
It appears to be working pretty well, though I don't understand the event lifecycle, so I don't really get why the if (record->event.pressed) is necessary, i just added it because it was registering twice without it.
Please let me know if there's anything I'm missing!
I have a plan to add action just like ACTION_MODS_KEY except for removing modifier instead of adding.
This would be great!
Hey Hasu, I'm having a weird issue. Again, I'm trying to simulate ctrl-[ (since I've mapped the normal ` key to ` instead of esc, because I actually use the ` key).
Here's the part of my setup that matters:
#define AC_L1 ACTION_LAYER_MOMENTARY(1)
#define AC_L2 ACTION_LAYER_MOMENTARY(2)
#define AC_1CTL ACTION_LAYER_MODS(1, MOD_LCTL)
#define AC_ESCX ACTION_FUNCTION_TAP(ESCX)
// emulates FC660C default keymap
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
[0] = KMAP(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, VOLU,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, VOLD,
1CTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP,
L2 ,LALT,LGUI, SPC, RGUI,RALT,L2, LEFT,DOWN,RGHT
),
[1] = KMAP(
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,ESCX,TRNS,TRNS, MUTE,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS,TRNS,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS
),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id) {
case ESCX:
if (record->event.pressed) {
unregister_mods(MOD_BIT(KC_LCTL));
register_code(KC_ESC);
unregister_code(KC_ESC);
register_mods(MOD_BIT(KC_LCTL));
}
break;
}
}
The problem is that AC_1CTL seems to have some delay before it triggers. I'm used to hitting ctrl-[ pretty quickly, which works natively in terminal emulators. But after applying this code, it often misses the ctrl part and I just end up typing [, which is very frustrating. Is this a known issue? Is there any way I can make ACTION_LAYER_MODS(1, MOD_LCTL) trigger more quickly?