-
Notifications
You must be signed in to change notification settings - Fork 69
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
Improve layer activation specification, for momentary or toggled activators #158
Comments
I like adding an What about nesting layers:
Base:
# Key types map to dictionaries with a 'title' (or 'legend'?) and an optional `activates` field
- {t: {title: StickySym, activates: Sym}, h: {title: Nav, activates: Nav}}
# The current simpler syntax could be remapped internally
- {t: Q, h: Ctrl} # Same as {t: {title: Q}, h: {title: Ctrl}}
- W # Same as {t: {title: W}} It would make the keymap YAML the only source of truth rather than parts of the logic being implicit in In terms of backwards compatibility, the current string matching logic could be moved to the parse step (if there is no Regarding the Similarly, the hyperlinking of layers could be based of draw_config:
layer_activators:
add_links: true # Replaces existing 'style_layer_activators' setting.
add_highlights: true # The analog for highlighting activators.
enabled_for_key_types: [hold] # Add 'tap' or set to 'all' to also highlight sticky layers etc.
# Not sure whether this setting should be shared for links and
# highlights or just apply to the latter. Footnotes
|
I think that plan seems good in general, thanks for writing it up! I hadn't thought about putting
The latter makes sense, in the parse step we don't need string matching, because we know (through parsing the behavior type, or are told via
We'd remove it in the parse output in favor of The only question I have is, how do we signify whether a key is |
There might be some conceptual misunderstanding of mine here. I am thinking of In your example, suppose Adding additional fields to differentiate between label position and tap/hold for highlighting purposes would be (slightly) more flexible but might not be worth the added complexity? In fact, ignoring the hyperlinking for a moment, it seems that by setting |
Adding to the previous, how about the following:
|
The crux of my problem is that I want to highlight(==mark held) only the layer activators that are momentary(==held), like I was initially thinking that your I think you are proposing to not make this distinction at all, at least by default, given the added complexity. I guess that's possible, but it'd be a breaking change as well without an easy way to restore the old behavior. Other than this point, your suggestions broadly makes sense to me. Footnotes
|
I didn't realize that would have been a regression. Agreed that wouldn't be great.
I think you are right, both would be functionally equivalent. And using flags here seems cleaner. I'd probably use something more related to the functionality though, e.g., - {t: {title: NAV, activates: NAV}} # &mo NAV
- {t: {title: NAV, activates: NAV, no_highlight}, h: toggle} # &tog NAV (This would be in addition to the global Footnotes
|
Currently, we have two visualization tools that link keys to layers that they activate:
held
key type, which indicates a held-down key while a layer is activedraw_config.style_layer_activators
The first one is determined by
keymap parse
(when it can, it fails for custom behaviors and customizations usingraw_binding_map
, see #113 and #157) and is reflected in the keymap YAML with thetype: held
field.The second one on the other hand, is determined by
keymap draw
through a simple string match: it only checks if the legend field is exactly equal to one of the layer names. This cannot be specified in any way in keymap YAML or customized withdraw_config
. For instance, the detection doesn't work when you useparse_config.layer_legend_map
to customize layer legends (#148).I think it is inelegant and not good design to have this incongruency, where at the end of the day, both features are tying layers to the keys they activate from. Both 1. and 2. should be able to be configured in keymap YAML or
draw_config
.Implementation alternatives: TBD
The text was updated successfully, but these errors were encountered: