<div dir="auto">IMO it's a mistake: we should always pass the keypress/release events as is to the image, that's what raw events means to be. Composition shall alter the keychar events only - that is some 1st level interpretation of the raw events...</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 17 janv. 2021 à 07:15, tim Rowledge <<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On 2021-01-16, at 9:17 PM, David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank" rel="noreferrer">lewis@mail.msen.com</a>> wrote:<br>
> <br>
> On Sat, Jan 16, 2021 at 04:03:45PM -0800, tim Rowledge wrote:<br>
>> <br>
>> <br>
>>> On 2021-01-16, at 3:33 PM, David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank" rel="noreferrer">lewis@mail.msen.com</a>> wrote:<br>
>>> . The part I<br>
>>> can't figure out is how it could be working on any of the VMs.<br>
>> <br>
>> I can't see any case where it can work either but the code is so convoluted you need a native guide. The one thing I can see that might just possibly account for differences is the way that x2sqKey is a function pointer that can end up pointing to any of three routines depending upon assorted commandline options, environment variables and phase of a random selection of Jupiter's moons.<br>
>> <br>
> <br>
> Exactly right. Well it's not exactly a function of Jupiter's moons, but<br>
> pretty darn close.<br>
> <br>
> I've narrowed the issue down some more, and can offer at least a<br>
> workaround for Scratch.<br>
> <br>
> The reason that the key up events are being lost is that either the<br>
> LC_ALL or the LC_CTYPE environment variable is set. If you unset both of<br>
> these, the key up events will start working.<br>
<br>
That's interesting. I had tried manually specifying the x2sqKeyPlain by using `-nointl` but it looks like it gets over-ridden pretty quickly. I see that on my Pi <br>
`<br>
echo $LC_ALL<br>
en_US.UTF-8<br>
`<br>
<br>
So it looks like the big difference is use of XmbLookupString vs XLookupString. Since as mentioned "We can't use XmbLookupString() since that is undefined for key release events." I guess maybe we might try using XLookupString for handling key release events ? It will potentially be wrong for times when a composited character was used but it's really hard to imagine what *wouldn't* be wrong. Maybe one might take comfort in the thought that using a composited character within the sort of Scratch script that uses key states is pretty close to unimaginable. Actually... checking... yes, impossible since the usable keys are a-z,0-9,yp,down,left,right,space. Maybe there is something in that which can drive a useful heuristic?<br>
<br>
Thanks so much for digging into this Dave.<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank" rel="noreferrer">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
A flash of light, a cloud of dust, and...  What was the question?<br>
<br>
<br>
<br>
</blockquote></div>