All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] macintosh: move mac_hid driver to input/mouse.
Date: Mon, 29 May 2017 20:03:25 +0200	[thread overview]
Message-ID: <20170529200325.7855f8a1@kitsune.suse.cz> (raw)
In-Reply-To: <20170528175540.GA8094@dtor-ws>

On Sun, 28 May 2017 10:55:40 -0700
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> On Sun, May 28, 2017 at 11:47:58AM +0200, Michal Suchanek wrote:
> > On Tue, 9 May 2017 17:43:27 -0700
> > Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> > 
> > If not then please do your job as maintainer and accept trivial
> > patches for perfectly working drivers we have now.  
> 
> I am doing my job as a maintainer right now. The driver might have
> been beneficial 15 years ago, when we did not have better options,
> but I would rather not continue expanding it's use.
> 
> The main problem with the driver is that the functionality it is not
> easily discoverable by end users. And once you plumb it through
> userspace to present users with options you might as well handle it
> all in userspace.
> 
...
> 
> >   
> > > 
> > > What hardware do you believe would benefit from this and why?  
> > 
> > Any touchpad hardware where you cannot press two buttons at once to
> > emulate the third button due to hardware design. And any touchpad
> > hardware on which some of the buttons are broken when it comes to
> > it.
> > 
> > It is built into a notebook and works fine for moving the cursor but
> > due to lack of usable buttons you still need a mouse to use the
> > notebook.  
> 
> Have you tried simply redefining keymap of your keyboard to emit
> BTN_RIGHT/BTN_MIDDLE? Both atkbd and HID keyboards support keymap
> updates from userspace/udev/hwdb and if there is a driver that does
> not support it I will take patches fixing that.

How is that more easily discoverable by users?

More importantly how is that mapping supposed to be represented in a
hwdb file?

The help text in the hwdb file says:

# Scan codes are specified as:
#   KEYBOARD_KEY_<hex scan code>=<key code identifier>
# The scan code should be expressed in hex lowercase. The key codes
# are retrieved and normalized from the kernel input API header.

So they are converted in some unspecified way.

The example below defines some mappings, presumably:

evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnGateway*:pnA0A1*:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svneMachines:pneMachines*E725:pvr*
 KEYBOARD_KEY_a5=help                                   # Fn+F1
 KEYBOARD_KEY_a6=setup                                  # Fn+F2
 KEYBOARD_KEY_a7=battery                                # Fn+F3

/usr/include/linux/input-event-codes.h has occurence of battery in

#define KEY_BATTERY		236

meaning that the unspecified conversion is probably performed by

1) stripping KEY_ prefix
2) converting to lowercase

This is what systemd hwdb check script does in reverse when checking
the keycode values.

The BTN_LEFT 0x110 value does not conflict with KEY_* values, though.
So technically you could include it in the keymap. If you had a tool
for that. And if it is not rejected by the kernel. And if it does not
crash your X server which is very picky about receiving pointer events
from a keyboard or the other way around.

Thanks

Michal

  reply	other threads:[~2017-05-29 18:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 19:14 [PATCH] macintosh: move mac_hid driver to input/mouse Michal Suchanek
2017-05-10  0:43 ` Dmitry Torokhov
2017-05-10 10:44   ` Michal Suchánek
2017-05-28  9:47   ` Michal Suchanek
2017-05-28 13:26     ` Bastien Nocera
2017-05-28 17:55     ` Dmitry Torokhov
2017-05-29 18:03       ` Michal Suchánek [this message]
2017-05-30  5:06         ` Dmitry Torokhov
2017-05-30  9:34           ` Michal Suchánek
2017-05-30 10:33             ` Benjamin Tissoires
2017-05-30 11:32               ` Michal Suchánek
2017-05-30 12:02                 ` Benjamin Tissoires
2017-05-30 12:56                   ` Michal Suchánek
2017-05-31  4:26                     ` Peter Hutterer
2017-06-07 12:29                       ` Michal Suchánek
2017-06-07 16:53       ` Michal Suchánek
2017-06-07 17:16         ` Dmitry Torokhov
2017-06-07 19:17           ` Michal Suchánek
2017-06-07 19:17             ` Michal Suchánek
2017-06-07 23:13             ` Peter Hutterer
2017-06-08 13:18               ` Michal Suchánek
2017-06-08 13:18                 ` Michal Suchánek
2017-06-08 23:07                 ` Peter Hutterer
2017-06-08 23:18                   ` Dmitry Torokhov
2017-06-08 23:18                     ` Dmitry Torokhov
2017-06-09 11:39                     ` Michal Suchánek
2017-06-09 11:39                       ` Michal Suchánek
2017-06-10  2:00                       ` Peter Hutterer
2017-06-12 11:40                         ` Michal Suchánek
2017-06-12 11:40                           ` Michal Suchánek
2017-06-12 13:27                           ` Michal Suchánek
2017-06-12 13:27                             ` Michal Suchánek

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=20170529200325.7855f8a1@kitsune.suse.cz \
    --to=msuchanek@suse.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.