Closed Spike-from-NH closed 1 month ago
I don't see it; the net result in that case seems to be:
keysflags |= (F_LOC<<1) | (F_LOC<<1)
—the same bit gets set twice?
[Edit: No, that's just for loc
keys. Then:
keysflags |= (0<<1) | (0<<1)
?]
I can try to write (by imitation) a function that takes parameters attr1
and attr2
. (Or better, modify parse_key_attr() to take two and behave as before if attr2
is empty?) (Then need another function if we stumble over a sensible third synonym?)
—the same bit gets set twice?
Not if the flags are different for the two conflicting keys.
Or better, modify parse_key_attr() to take two and behave as before if attr2 is empty?
I prefer having smaller functions that combine well rather than a bigger function that takes more arguments. But if you have an implementation in mind, go ahead.
Not if the flags are different for the two conflicting keys.
But two synonyms have the same flag! So I'm still not convinced there is a bug. If there is not, just listing synonyms is better than creating a brittle function based on there being exactly two synonyms.
By the way, I don't care which prevails if the user specifies both nw=
and key1=
, though ideally, your new pop-up diagnostic should warn that the user may be confused.
But two synonyms have the same flag! So I'm still not convinced there is a bug.
Here's an example of where this bug can show up: Start from the default layout:
<key key0="d" key1="loc accent_grave" key2="loc £" key3="loc accent_aigu"/>
Add nw="¡"
to this key. The added key will not show up.
If there is not, just listing synonyms is better than creating a brittle function based on there being exactly two synonyms.
The implementation I have in mind is not brittle.
ideally, your new pop-up diagnostic should warn that the user may be confused.
That would also be a good way to do it! This definitely requires a new function.
Add
nw="¡"
to this key. The added key will not show up.
Well, because the definition now includes two contradictory specifications for the northwest swipe (one with a LOC bit and one without). Again, I don't care what results in this case but, yes, a pop-up should warn the user.
How shall we proceed? I finally put a modern browser on a big tablet (so I won't get "Something went wrong!") but I am slow at writing Java, have not studied your diagnostic routine, and have no way to test my code before submitting.
Then, an error is definitely the best solution! I can suggest an implementation later this week.
I've made more edits to this file. I saw a warning I had unsaved changes and blew past it. I leave it to @Julow to issue the pop-up error if both synonyms are defined incompatibly.
Thank you for correcting, completing, merging, and yet calling it awesome!
Adds eight compass-point synonyms for key1 through key8