Patch revision 3449 messes with keyboard(7) interpretations.

Anonymous avatarAnonymous created an issue

In devdraw/acme, we have the ability to enter certain unicode symbols as per keyboard(7). For instance, Alt-*-m types the greek letter μ. The problem is that on X11, the patch in revision 3449 seem to break this. Rolling back to revision 3448 fixes the problem instantly.

The wrong behavior is that the shift keypress "breaks" the Alt-sequence. So if you type Alt and then KeyPress the left shift to type the *, by pressing 8, this seem to break the Alt-sequence and a * is typed. An hg blame run shows that revision 3449 changes the behavior of mouse button clicks in devdraw, so you can type other buttons by holding down alt and control. Perhaps this messes with the keyboard(7) behavior?

Comments (7)

  1. knieriem

    In function /usr/local/plan9/src/cmd/devdraw/x11-itrans.c:/__xtoplan9kbd you can replace the test

    if(r < 0)
    

    with

    if(r == -1)
    

    to make it work again.

    It has something to do with the type of r having changed from int to Rune, which is unsigned, so a "< 0" won't be possible for r anymore. As a result, for key values like shift the function is not left at this point, but the key value is propagated to sendrune, which will terminate the compose sequence.

  2. eaburns

    Not sure if it's helpful, but I am seeing another related problem: if I use alt+shift to get the window menu so that I can put acme in full screen mode, then my mouse button 1 seems to be re-interperted as mouse button 3 until I press both alt keys at the same time. I reverted to 3448 (e9cdfa957952) and that issue is fixed along with the keyboard(7) problem.

  3. Aymeric Mansoux

    The suggested change from knieriem was committed in e963085. However it does not bring back fully the compose key functionality in acme.

    By default the compose key works both as sticky (press the compose key, release, press the other key) and non-sticky (press the compose key and while holding it you press the other key).

    With this patch the compose key in acme only work in sticky mode. Prior to r3449 (or r3448) it was working both ways like in any other applications. It makes it very hard now to use the compose key if you are used to hold it (pretty much like a shift key).

  4. Russ Cox

    The sticky way was never intended. That's not how Plan 9 works either. It's not a huge loss that it's gone. If it's trivial to bring back, feel free to send a patch.

    Russ

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.