Skip to content

actions: Add VoidAction(), mirroring NoSymbol/VoidSymbol. #763

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wismill
Copy link
Member

@wismill wismill commented May 9, 2025

Added VoidAction() action to match the keysym pair NoSymbol / VoidSymbol.

It enables erasing a previous action and breaks latches.

This is a libxkbcommon extension. When serializing it will be converted to LockControls(controls=none,affect=neither) for backward compatibility. We cannot serialize it to NoAction(), as it would be dropped in e.g. the context of multiple actions.

Fixes #622

@mahkoh @Jules-Bertholet

@wismill wismill added this to the 1.10.0 milestone May 9, 2025
@wismill wismill added the compile-keymap Indicates a need for improvements or additions to keymap compilation label May 9, 2025
It enables erasing a previous action and breaks latches.

This is a libxkbcommon extension. When serializing it will be converted to
`LockControls(controls=none,affect=neither)` for backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does LockControls also break latches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. See also our own xkb_action_breaks_latch().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, AIUI, VoidAction is just a nicer alias for the LockControls action. If so, this LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. This brings better semantics and we can make it a proper independent action later. I chose LockControls(controls=none,affect=neither) because it seems the only portable action we support that would cause no side effect other than breaking latches. SetControls() may be fine too, but the affect=neither field of LockControls seems to better ensure it is a dummy action.

@mahkoh
Copy link
Contributor

mahkoh commented May 9, 2025

mahkoh/kbvm#45

Added `VoidAction()` action to match the keysym pair
`NoSymbol` / `VoidSymbol`.

It enables erasing a previous action and breaks latches.

This is a libxkbcommon extension. When serializing it will be converted to
`LockControls(controls=none,affect=neither)` for backward compatibility.
We cannot serialize it to `NoAction()`, as it would be dropped in e.g.
the context of multiple actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add VoidAction() to mirror NoSymbol/VoidSymbol
2 participants