Skip to content

Conversation

@Ph4ntomas
Copy link
Contributor

This PR address a few issue I have with the current Layer::on_key_pressed

I've cherry-picked some commits from #369 (the one to emit the text in events).

To avoid breaking current config, Layer::on_key_pressed was mostly kept as-is, except I'm explicitly discarding events if they were captured, since they used to be discarded on the server side. I don't know if the function should be marked as deprecated, or kept as a short-hand if only key press are needed.

I did not add Layer::on_key_release, since:

  • This is already covered by the new Layer::on_key_event() function.
  • There's no way to have several handlers, and I don't feel like only handling key release events make sense.

closes #374

The on_key_pressed handler can be limiting since:
- it doesn't allow to react to key being released
- it doesn't transmit the processed `text` associated with keys when
  using a layout with dead keys.
- it doesn't transmit captured events (I've added this one to conserve
  the previous behavior.)

This commit address this by adding a on_key_event that transmit the key
state, whether it was captured on the server side, and the associated
text if available.
The on_key_pressed handler can be limiting since:
- it doesn't allow to react to key being released
- it doesn't transmit the processed `text` associated with keys when
  using a layout with dead keys.
- it doesn't transmit captured events (I've added this one to conserve
  the previous behavior.)

This commit address this by adding a on_key_event that transmit the key
state, whether it was captured on the server side, and the associated
text if available.
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.

[Snowcap] Let captured input go through

1 participant