{"id":5133,"date":"2024-03-18T14:47:02","date_gmt":"2024-03-18T13:47:02","guid":{"rendered":"https:\/\/pmortensen.eu\/world2\/?p=5133"},"modified":"2025-08-27T18:19:36","modified_gmt":"2025-08-27T17:19:36","slug":"the-basis-for-cancelling-via-macros-in-progress-and-for-making-via-macros-repeat","status":"publish","type":"post","link":"https:\/\/pmortensen.eu\/world2\/2024\/03\/18\/the-basis-for-cancelling-via-macros-in-progress-and-for-making-via-macros-repeat\/","title":{"rendered":"The basis for cancelling Via macros in progress and for making Via macros repeat"},"content":{"rendered":"<p>The idea is to capture the <a href=\"https:\/\/docs.keeb.io\/via\">Via<\/a> macro execution in function <a href=\"https:\/\/github.com\/qmk\/qmk_firmware\/blob\/master\/quantum\/dynamic_keymap.c#L257\"><em>dynamic_keymap_macro_send()<\/em><\/a> (in file <a href=\"https:\/\/github.com\/qmk\/qmk_firmware\/blob\/master\/quantum\/dynamic_keymap.c\"><em>quantum\/dynamic_keymap.c<\/em><\/a>) and instead feed the information into an existing <a href=\"https:\/\/docs.qmk.fm\/#\/faq_general?id=what-is-qmk\">QMK<\/a> macro engine that has cancelling macros and repeating macros as features.<\/p>\n<h2>Introduction<\/h2>\n<p>It is relatively straightforward to <a href=\"https:\/\/pmortensen.eu\/world2\/2023\/07\/31\/the-basis-for-a-way-to-cancel-qmk-macros-in-progress\/\">write a macro engine that will both allow cancelling macros in progress<\/a> and by extension also allow repeating macros. I have implemented one and have been using it on Keychron keyboards for many months without ill effects.<\/p>\n<p>There are sometimes <a href=\"https:\/\/www.reddit.com\/r\/Keychron\/comments\/19fn0j3\/comment\/lc3lh1p\/\">problems in wireless mode<\/a>, but they are probably unrelated to the macro execution engine as there are general problems with wireless Keychron keyboards, and the macros work without any problems in wired mode.<\/p>\n<p>The nature of these problems are not known at this time, but it may be related to keyboard sleep. The problem is intermittent; sometimes it works fine and sometimes not (for example, does not work at all&mdash;nothing happens when macro keys are pressed). <\/p>\n<h2>Analysis<\/h2>\n<p>The (binary) format of the buffer built up by the interpretation of the raw (emulated) EEPROM data <a href=\"https:\/\/pmortensen.eu\/world2\/2023\/07\/31\/the-basis-for-a-way-to-cancel-qmk-macros-in-progress#ViaMacroBinaryFormat\">was previously covered<\/a>. That is the output from <em>dynamic_keymap_macro_send()<\/em> and we need to handle the input, not the output.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The idea is to capture the Via macro execution in function dynamic_keymap_macro_send() (in file quantum\/dynamic_keymap.c) and instead feed the information into an existing QMK macro engine that has cancelling macros and repeating macros as features. Introduction It is relatively straightforward &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/pmortensen.eu\/world2\/2024\/03\/18\/the-basis-for-cancelling-via-macros-in-progress-and-for-making-via-macros-repeat\/\"> <span class=\"screen-reader-text\">The basis for cancelling Via macros in progress and for making Via macros repeat<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,28,26,35,16,38],"tags":[],"_links":{"self":[{"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/posts\/5133"}],"collection":[{"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/comments?post=5133"}],"version-history":[{"count":15,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/posts\/5133\/revisions"}],"predecessor-version":[{"id":5633,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/posts\/5133\/revisions\/5633"}],"wp:attachment":[{"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/media?parent=5133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/categories?post=5133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pmortensen.eu\/world2\/wp-json\/wp\/v2\/tags?post=5133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}