Skip to content

Validate smart macro event names#1541

Closed
kareltucek wants to merge 1 commit intoUltimateHackingKeyboard:masterfrom
kareltucek:validate-smart-events
Closed

Validate smart macro event names#1541
kareltucek wants to merge 1 commit intoUltimateHackingKeyboard:masterfrom
kareltucek:validate-smart-events

Conversation

@kareltucek
Copy link
Copy Markdown
Collaborator

Macro names that begin with $ are treated as event handlers
(e.g. $onInit, $onKeymapChange, $onLayerChange). Until now,
unknown event names like $onKeyMapChange (camel-case typo) were
silently ignored, leaving the user with a non-functional handler and
no diagnostic.

Walk all macros after Macros_ValidateAllMacros and emit a status
buffer error for any $-prefixed name that doesn't match a known
event, has the wrong number of arguments, or specifies a layer name
that Macros_ConsumeLayerId rejects.

Refs #1536

Macro names that begin with `$` are treated as event handlers
(e.g. `$onInit`, `$onKeymapChange`, `$onLayerChange`). Until now,
unknown event names like `$onKeyMapChange` (camel-case typo) were
silently ignored, leaving the user with a non-functional handler and
no diagnostic.

Walk all macros after Macros_ValidateAllMacros and emit a status
buffer error for any `$`-prefixed name that doesn't match a known
event, has the wrong number of arguments, or specifies a layer name
that Macros_ConsumeLayerId rejects.

Refs UltimateHackingKeyboard#1536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant