From: Jiri Slaby <jirislaby@kernel.org>
To: Tammo Block <tammo.block@gmail.com>, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 1/6] tiocl.h: Change/Add defines for mouse report
Date: Tue, 30 Jun 2020 09:55:27 +0200 [thread overview]
Message-ID: <f00141ec-5da4-2743-7064-8094d7915f7c@kernel.org> (raw)
In-Reply-To: <159375ce8dcdbcada6fa079f0a120765b10a84a7.1593499846.git.tammo.block@gmail.com>
On 30. 06. 20, 9:10, Tammo Block wrote:
> Add additional defines for mouse event types. The change of the value
> of TIOCL_SELBUTTONMASK deserves a bit more explanation :
>
> The old value of 15 uses the first 4 bits and sends them unchanged back
> to userspace if requested by an application. But in fact only the first
> two bits have ever been used by any daemon or useful at all, as the
> kernel already knows the status of the shift and alt keys encoded in
> bits 3 and 4. On the other hand we *do* want to know the status of bits
> 6-8, encoding button values >3 and mouse move and drag operations.
>
> This change is up- and downwards compatible by masking all spourious
> bits and leaving only the undisputed parts (bits 1 and 2) untouched.
>
> Signed-off-by: Tammo Block <tammo.block@gmail.com>
> ---
> include/uapi/linux/tiocl.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/tiocl.h b/include/uapi/linux/tiocl.h
> index b32acc229024..c862053041e4 100644
> --- a/include/uapi/linux/tiocl.h
> +++ b/include/uapi/linux/tiocl.h
> @@ -9,7 +9,7 @@
> #define TIOCL_SELPOINTER 3 /* show the pointer */
> #define TIOCL_SELCLEAR 4 /* clear visibility of selection */
> #define TIOCL_SELMOUSEREPORT 16 /* report beginning of selection */
> -#define TIOCL_SELBUTTONMASK 15 /* button mask for report */
> +#define TIOCL_SELBUTTONMASK 227 /* button mask for report */
0xe3 is more obvious (can be in-brain translated to bits).
If C only had 0b prefix like perl has...
> /* selection extent */
> struct tiocl_selection {
> unsigned short xs; /* X start */
> @@ -28,7 +28,11 @@ struct tiocl_selection {
>
> /* these two don't return a value: they write it back in the type */
> #define TIOCL_GETSHIFTSTATE 6 /* write shift state */
> -#define TIOCL_GETMOUSEREPORTING 7 /* write whether mouse event are reported */
> +#define TIOCL_GETMOUSEREPORTING 7 /* write which mouse event are reported */
s/event/&s/
> +#define TIOCL_REPORTBTNPRESS 1 /* report button press only "9" */
> +#define TIOCL_REPORTRELEASE 2 /* report press and release "1000" */
> +#define TIOCL_REPORTDRAG 3 /* report drag events "1002" */
> +#define TIOCL_REPORTANYMOVE 4 /* report any movement "1003" */
> #define TIOCL_SETVESABLANK 10 /* set vesa blanking mode */
> #define TIOCL_SETKMSGREDIRECT 11 /* restrict kernel messages to a vt */
> #define TIOCL_GETFGCONSOLE 12 /* get foreground vt */
>
thanks,
--
js
suse labs
next prev parent reply other threads:[~2020-06-30 7:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 7:09 [PATCH v1 0/6] vt: Add SRG mouse reporting features Tammo Block
2020-06-30 7:10 ` [PATCH v1 1/6] tiocl.h: Change/Add defines for mouse report Tammo Block
2020-06-30 7:55 ` Jiri Slaby [this message]
2020-06-30 7:10 ` [PATCH v1 2/6] console_struct.h: Two members " Tammo Block
2020-06-30 7:11 ` [PATCH v1 3/6] vt/vt: Enable mode change via escape sequence Tammo Block
2020-06-30 7:11 ` [PATCH v1 4/6] vt/vt: Add SRG mouse reporting protocol Tammo Block
2020-06-30 7:59 ` Jiri Slaby
2020-06-30 7:11 ` [PATCH v1 5/6] vt/vt: Add URXVT " Tammo Block
2020-06-30 7:12 ` [PATCH v1 6/6] Documentation: Describe console mouse reporting Tammo Block
2020-06-30 8:16 ` Jiri Slaby
2020-06-30 16:14 ` Randy Dunlap
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=f00141ec-5da4-2743-7064-8094d7915f7c@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tammo.block@gmail.com \
/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
Powered by JetHome