Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple modmaps in a custom layout #675

Closed
Spike-from-NH opened this issue Jun 21, 2024 · 5 comments
Closed

Multiple modmaps in a custom layout #675

Spike-from-NH opened this issue Jun 21, 2024 · 5 comments

Comments

@Spike-from-NH
Copy link
Contributor

During the development of pull request #666, @Julow stated that any second modmap in a custom layout erases the previous modmap. This is not what the author wants. Julow's proposed solution is ➊ to document the rule that there can be at most one modmap (now done); and ➋ to issue an error on encountering an additional modmap (for which this issue is a placeholder).

The author might want multiple modmaps: He might believe it makes the layout more readable if each <row>...</row> is immediately followed by mods that apply to keys in that row. Unexpected could batch all modmap data before processing any of them, or set a flag that it has created a data structure of mods, so as to avoid erasing it on additional modmaps.

In fact, the author might want each key to be followed by mods that apply to that key, also for readability. This argues for also dropping the documented restriction that modmap must be inside keyboard but outside any row.

@Julow
Copy link
Owner

Julow commented Jun 22, 2024

Having multiple modmap make little sense as a single <modmap> node can hold any number of mappings. Having modmaps inside rows make no sense internally. Let's enforce only one modmap is present.

@Spike-from-NH
Copy link
Contributor Author

It's your call, and a minor issue in any case, but the "sense," again, is readability.

Having modmaps inside rows make no sense internally.

Of course, because the modmap is a separate structure. But it does make sense to the reader of the layout to group together all specs that apply to a given key. Why force the author to write according to the internals?

@Julow
Copy link
Owner

Julow commented Jun 23, 2024

I'm not convinced having the modmaps between the keys would improve the visibility. That makes the rows harder to read as not every elements are keys and that makes it harder to see all the mappings at once.
The separate modmap is what makes the most sense at every levels.

@Julow
Copy link
Owner

Julow commented Jun 29, 2024

I added some validation in 45fc185
This not complete and it's still possible to write nonsensical layouts but at least redefining the modmap is.

@Spike-from-NH
Copy link
Contributor Author

This doesn't seem to have doc impact as, for now, it just enforces the rule we give.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants