diff --git a/data/keyd-application-mapper.1.gz b/data/keyd-application-mapper.1.gz index 1769f08..a3668b2 100644 Binary files a/data/keyd-application-mapper.1.gz and b/data/keyd-application-mapper.1.gz differ diff --git a/data/keyd.1.gz b/data/keyd.1.gz index be21038..12fb1b6 100644 Binary files a/data/keyd.1.gz and b/data/keyd.1.gz differ diff --git a/docs/keyd.scdoc b/docs/keyd.scdoc index 6aa564f..e633430 100644 --- a/docs/keyd.scdoc +++ b/docs/keyd.scdoc @@ -332,8 +332,8 @@ arguments. *toggle()* Permanently toggle the state of the given layer. -*overload(, )* - Activates the given layer while held and executes the provided macro when tapped. +*overload(, )* + Activates the given while held and executes on tap. *timeout(, , )* If the key is held in isolation for more than _ ms_, activate the first diff --git a/src/descriptor.c b/src/descriptor.c index 71070b2..0078f75 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -34,7 +34,7 @@ static struct { { "oneshot", OP_ONESHOT, { ARG_LAYER } }, { "toggle", OP_TOGGLE, { ARG_LAYER } }, { "layer", OP_LAYER, { ARG_LAYER } }, - { "overload", OP_OVERLOAD, { ARG_LAYER, ARG_MACRO } }, + { "overload", OP_OVERLOAD, { ARG_LAYER, ARG_DESCRIPTOR } }, { "timeout", OP_TIMEOUT, { ARG_DESCRIPTOR, ARG_TIMEOUT, ARG_DESCRIPTOR } }, { "macro2", OP_MACRO2, { ARG_TIMEOUT, ARG_TIMEOUT, ARG_MACRO } }, }; diff --git a/src/keyboard.c b/src/keyboard.c index 57efb6e..d702a6d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -383,6 +383,7 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code, switch (d->op) { struct macro *macro; struct layer *layer; + struct descriptor *descriptor; uint8_t mods; case OP_KEYSEQUENCE: @@ -428,7 +429,7 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code, break; case OP_OVERLOAD: layer = &layers[d->args[0].idx]; - macro = ¯os[d->args[1].idx]; + descriptor = &descriptors[d->args[1].idx]; if (pressed) { activate_layer(kbd, code, layer); @@ -438,8 +439,9 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code, if (kbd->last_pressed_code == code) { clear_oneshot(kbd); - update_mods(kbd, dl, 0); - execute_macro(kbd, dl, macro); + + process_descriptor(kbd, code, descriptor, dl, 1); + process_descriptor(kbd, code, descriptor, dl, 0); } update_mods(kbd, NULL, 0); diff --git a/t/overload5.t b/t/overload5.t new file mode 100644 index 0000000..84f2418 --- /dev/null +++ b/t/overload5.t @@ -0,0 +1,21 @@ +7 down +7 up +x down +x up +7 down +x down +x up +7 up + +meta down +control down +meta up +control up +control down +x down +x up +control up +meta down +x down +x up +meta up diff --git a/t/test.conf b/t/test.conf index 73d2543..ed653ff 100644 --- a/t/test.conf +++ b/t/test.conf @@ -16,6 +16,7 @@ w = oneshot(customshift) 4 = toggle(test) 5 = layer(symbols) 6 = overload(6l, esc) +7 = overload(meta, oneshot(control)) 9 = M-C-S-x q = toggle(M-C-A) l = layer(test)