Skip to content

Conversation

@sezanzeb
Copy link
Owner

@sezanzeb sezanzeb commented Nov 5, 2024

Adds a convenient macro for #996

Name matches how other tools call it, like https://docs.qmk.fm/mod_tap

This differs from the second example of Nested tap in https://github.com/qmk/qmk_firmware/blob/78a0adfbb4d2c4e12f93f2a62ded0020d406243e/docs/tap_hold.md#nested-tap-abba-nested-tap. There, it would write ab instead of B. Because I don't think there is any easy way to suppress an event that is not used as an input for something in input-remapper (b in this case). When it is seen by the mod_tap macro, the mod_tap macro has to decide what to do, right now, and it will have to inject its default key.

A mode parameter could be introduced later, which could accept something like "QMK_DEFAULT" or "PERMISSIVE_HOLD" and stuff.

Or, we could already maybe make event carry a event.dont_forward flag, that prevents it from being forwarded. In that case, the mod_tap macro has to inject all the events that arrived while the modifier was held down when it is released.

TODO:

@sezanzeb sezanzeb mentioned this pull request Nov 5, 2024
another_key_pressed_event.set()
return

self.context.listeners.add(listener)
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Item "None" of "Context | None" has no attribute "listeners" [union-attr]

for task in tasks:
task.cancel()

self.context.listeners.remove(listener)
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Item "None" of "Context | None" has no attribute "listeners" [union-attr]

@sezanzeb sezanzeb closed this Nov 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants