From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 3A15523F3F for ; Sat, 29 Jun 2024 19:20:55 +0200 (CEST) Received: from out-174.mta0.migadu.com ([91.218.175.174]) by 9front; Sat Jun 29 13:19:42 -0400 2024 X-Envelope-To: 9front@9front.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trbsw.dev; s=key1; t=1719681579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q98xuw66Q5RKWvVxE4RfQS8j05UmelIMQH3LmCl4AqI=; b=b58/T4UQKJKetLkh9L2CUua9N1xbYgt1sooIOxp20FDh3WO3RBZiseqYbjjXkZmF9+G60B 4Hvlws03qeSPsY5Fxn7VtWRtrAWePntNMfUzH6RY1/39fkx1hKrG51+uDkgJOzjvAiyDQ8 iqwiA6/SSNvQ+HlPXoe2g7GzBbAs5sU= Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 29 Jun 2024 13:19:35 -0400 Message-Id: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Timothy Robert Bednarzyk" To: <9front@9front.org> References: In-Reply-To: X-Migadu-Flow: FLOW_OUT List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: stateless CSS polling CSS GPU-scale callback package-scale database Subject: Re: [9front] [PATCH] Fix shift release events in X11 drawterm with shift:both_capslock xmodmap option Reply-To: 9front@9front.org Precedence: bulk > 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