You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2a2a8d7 introduced the handling of Caps and Control keysyms transformations.
However, it works only for xkb_state_key_get_one_sym, but not for xkb_state_key_get_syms:
Also, only xkb_state_key_get_one_sym() is changed;
xkb_state_key_get_syms() is left as-is, and always reports the
untransformed keysyms.
I would like to revisit this decision:
This is for the following reasons:
The API doesn't allow it, since we return a const pointer directly to
the keymap keysyms table and we can't transform that.
We could use an internal buffer, such as for the Compose iterator (see xkb_compose_table_iterator::entry). As we discussed in #300, xkb_state is not meant to be thread-safe.
The transformation doesn't make sense for multiple-keysyms.
I disagree: it feels quite a counter-intuitive result.
It can be useful for an application to get the "raw" keysyms if it
wants to (e.g. maybe it wants to do the transformation itself).
This is a valid point. But note that they are always available with xkb_keymap_key_get_syms_by_level.
I see 2 directions:
Change the current API to support Caps transformation and use an internal buffer. This is a obviously a breaking change. Potential issue: we do not constraint the keysyms count, so what size should the buffer have?
Add a new API xkb_state_key_get_syms2 with a flag to set which transformation should be performed. We should probably let the user provide the keysyms buffer, much like xkb_state_key_get_utf8. Note that as stated above, we do not constraint the keysym count, so we should provide a feedback in case the buffer is too small.
Option 2 seems the safest.
The text was updated successfully, but these errors were encountered:
2a2a8d7 introduced the handling of Caps and Control keysyms transformations.
However, it works only for
xkb_state_key_get_one_sym
, but not forxkb_state_key_get_syms
:I would like to revisit this decision:
We could use an internal buffer, such as for the Compose iterator (see
xkb_compose_table_iterator::entry
). As we discussed in #300,xkb_state
is not meant to be thread-safe.I disagree: it feels quite a counter-intuitive result.
This is a valid point. But note that they are always available with
xkb_keymap_key_get_syms_by_level
.I see 2 directions:
xkb_state_key_get_syms2
with a flag to set which transformation should be performed. We should probably let the user provide the keysyms buffer, much likexkb_state_key_get_utf8
. Note that as stated above, we do not constraint the keysym count, so we should provide a feedback in case the buffer is too small.Option 2 seems the safest.
The text was updated successfully, but these errors were encountered: