public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Mouse button swapping
Date: Mon, 12 Dec 2005 12:45:29 +0100	[thread overview]
Message-ID: <20051212114529.GA6533@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.61.0512091508250.8080@yvahk01.tjqt.qr>

Hi!

> I produced a small patch that allows one to flip the mouse buttons at the 
> kernel level. This is useful for changing it on a per-system basis, i.e. it 
> will affect gpm, X and VMware all at once. It is changeable through
> /sys/module/mousedev/swap_buttons at runtime. Is this something mainline would
> be interested in?

Hopefully not. This should _not_ be done at kernel level. But fixing
X, gpm and vmware to load same config would be nice....
								Pavel

> diff -dpru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
> --- a/drivers/input/mousedev.c	2005-10-22 20:59:22.000000000 +0200
> +++ b/drivers/input/mousedev.c	2005-11-22 19:32:01.000000000 +0100
> @@ -40,6 +40,10 @@ MODULE_LICENSE("GPL");
>  #define CONFIG_INPUT_MOUSEDEV_SCREEN_Y	768
>  #endif
>  
> +static unsigned int swap_buttons = 0;
> +module_param(swap_buttons, uint, 0644);
> +MODULE_PARM_DESC(swap_buttons, "Swap left and right mouse buttons");
> +
>  static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
>  module_param(xres, uint, 0);
>  MODULE_PARM_DESC(xres, "Horizontal screen resolution");
> @@ -191,10 +195,10 @@ static void mousedev_key_event(struct mo
>  		case BTN_TOUCH:
>  		case BTN_0:
>  		case BTN_FORWARD:
> -		case BTN_LEFT:		index = 0; break;
> +		case BTN_LEFT:		index = !!swap_buttons; break;
>  		case BTN_STYLUS:
>  		case BTN_1:
> -		case BTN_RIGHT:		index = 1; break;
> +		case BTN_RIGHT:		index = !swap_buttons; break;
>  		case BTN_2:
>  		case BTN_STYLUS2:
>  		case BTN_MIDDLE:	index = 2; break;
> # eof
> 
> 
> Jan Engelhardt

-- 
Thanks, Sharp!

  parent reply	other threads:[~2005-12-14 11:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-09 14:10 Mouse button swapping Jan Engelhardt
2005-12-12 11:08 ` Clemens Koller
2005-12-12 11:45 ` Pavel Machek [this message]
2005-12-13  6:08 ` Dmitry Torokhov
2005-12-13  7:34   ` Vojtech Pavlik

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=20051212114529.GA6533@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.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