9front - general discussion about 9front
 help / color / mirror / Atom feed
From: "Timothy Robert Bednarzyk" <mail@trbsw.dev>
To: <9front@9front.org>
Subject: Re: [9front] [PATCH] Fix shift release events in X11 drawterm with shift:both_capslock xmodmap option
Date: Sat, 29 Jun 2024 13:19:35 -0400	[thread overview]
Message-ID: <D2CO8PJYSXUE.2EFN7GXQFN84R@trbsw.dev> (raw)
In-Reply-To: <CAFSF3XP_RLQ2DsMEBXtkrK6eJCaDfuWR2Kk9NCfevgiVgfMpOQ@mail.gmail.com>

> what exactly are you receiving from x11 when you "enable" your
> double-shift-caps-lock?
>
> 1. shiftdown_left 2. shiftdown_right 3. capslockdown 4. shiftup_left
> 5. shiftup_right 6. capslocksup ?
> which of these are visible, or are they in a different order? e.g. i
> can easily imagine something like 123645

Below, to the left of each colon represents what I am physically doing
and to the right represents the events that occur in X11. On the left, I
will use PL/PR for me pressing the left/right shift keys and RL/RR for
releasing the left/right shift keys. On the right, I will use your
numbers.

PL, RL: 1, 6.

PR, RR: 2, 6.

PL, PR, RL, RR: 1, 3, 6, 5.

PL, PR, RR, RL: 1, 3, 6, 6.

PR, PL, RL, RR: 2, 3, 6, 6.

PR, PL, RR, RL: 2, 3, 6, 4.

Interestingly, if I press one shift key, then the other, release the
first shift key, and then release the second one, I do actually get the
release event for the second shift key. I also don't get a press event
for that second shift key, but that makes sense to me since pressing the
second shift key is supposed to be interpreted as pressing caps lock
anyways. Perhaps most interesting to me though is that if I instead
release the second shift key before the first one I get two events for
releasing the caps lock in a row and zero events for releasing shift
keys.

While the press/release events work strangely with xmodmap's
shift:both_capslock option, the modifier masks do behave normally and I
believe that is why I have never noticed a problem in any other program
in the ~2/3 of a year that I've been using it (and why I wasn't stuck
typing in all caps through drawterm despite the mouse buttons staying
swapped). Perhaps a more robust solution to the problem would be to
probe the current state of the modifiers when handling things such as
mouse button presses rather than to rely on press/release events, but I
don't know nearly enough to know how difficult or feasible doing that
would be.

--
trb

  reply	other threads:[~2024-06-29 17:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28 23:53 Timothy Robert Bednarzyk
2024-06-29  0:30 ` Jacob Moody
2024-06-29 11:16   ` Timothy Robert Bednarzyk
2024-06-30 16:53     ` Jacob Moody
2024-06-30 19:22       ` Timothy Robert Bednarzyk
2024-06-29 16:31 ` hiro
2024-06-29 17:19   ` Timothy Robert Bednarzyk [this message]
2024-06-30 16:39     ` hiro
2024-06-30 19:08       ` Timothy Robert Bednarzyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D2CO8PJYSXUE.2EFN7GXQFN84R@trbsw.dev \
    --to=mail@trbsw.dev \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).