-
Notifications
You must be signed in to change notification settings - Fork 124
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
Incorrect group latch behavior #577
Comments
My understanding of the spec is that the second cycle should keep the latched group at 2, no? To get the latch to increment by 1 each time, you would want |
The delta, between the previously pressed group and the newly pressed group, is 1 both times. Relative changes only affect how the newly pressed group is calculated. The delta calculation is independent of that. |
The first latch increments the latched group from 1 to 2 (delta +1), and the second from 2 to 2 (delta +0), no? |
The latched group is irrelevant for the pressed delta. |
SA_LatchGroup:
SA_SetGroup:
So, the delta is presumably (group set after key press) - (group set before key press), and that delta is applied to the latched group on |
There is no such thing as "the group". Pressing the key affects the base group and releasing the key affects the base and latched group. The effective group is a derived property. |
The set group is 0 at the start of each line in the test. |
Ah, I think I see my error. You are entirely correct. Apologies for the noise. |
That being said, I think that the specified behavior is very counterintuitive. To determine the actual effect of a latch, you have to translate the 1-based absolute group index specified in the symbols file to a 0-based delta, then add the (also 0-based, even though symbols file uses 1-based) locked and base groups to get the 0-based effective group. This also makes |
@mahkoh Good catch! I filed a fix in #580. I also updated the test with the third group locked.
@Jules-Bertholet I agree that the computations related to groups may be counter-intuitive, but unfortunately this is the behavior defined by the XKB protocol. I got a similar issue a while ago.
We cannot depart from it or make it configurable unless we introduce format versions. This is what currently blocks #527; see also #484. Meanwhile one has to use the group keysyms/actions carefully to achieve the desired behavior. |
Consider this test case:
where, effectively,
The test passes but the behavior is not correct. The second compose cycle should set the latched group to Group3.
I noticed this when porting this test to my implementation. The following is the output of my test:
This follows from both the specification and the X server implementation.
The text was updated successfully, but these errors were encountered: