For example, the total number of key actions available to macros defined in Via can be increased from about 150 to use most of the free flash memory, using emulated EEPROM memory.
On the Keychron V5, this increased the total number of key actions to about 2,300 key actions by changing the default 2 KB to 20 KB. The maximum is about 8,000 key actions for this keyboard, depending on the configuration of QMK.
There doesn’t seem to be an inherent limit to the number of key actions per macros (other than the total number of key actions). I have tested it with one of my standard (and heavily used) macros with 220 key actions.
How-to
In file config.h, change
#define WEAR_LEVELING_LOGICAL_SIZE 2048
to:
#define WEAR_LEVELING_LOGICAL_SIZE 20480
Then recompile and flash the QMK firmware.
This increases the total (emulated) EEPROM size tenfold. The number of key actions available in Via changes even more than tenfold (as there is a fixed overhead due to EEPROM memory used for other purposes in QMK). Approximately 13 times more key actions are available after the change compared to the default values.
How does it work?
Instead of being restricted to the very limited size of physical EEPROM memory, EEPROM memory can instead be emulated by using the free flash memory not used by the QMK firmware. This is a feature built into QMK.
On a Keychron V5, there is typically, depending on compile-time configuration, etc., about 70 KB left for this purpose. In fact, the microcontroller in Keychron V5 doesn’t have any onboard EEPROM, so EEPROM memory must be emulated in flash memory.
There is a reserved size for this use of the free flash memory, but it can be increased as described above. But note that, due to internal limitations in QMK, the maximum size of the emulated EEPROM for use by Via is 65535 bytes (see source file quantum/dynamic_keymap.c).
But they are still crippled
For instance, mouse actions (say, right click) are not supported in macros. Such macros must be defined in C code in QMK.
There are only 16 macros and it is not possible to give them a name to remember what they do. This must be documented somewhere else, e.g., in a text document (and updated whenever the Via macros are changed or extended).