Insyde Input Devices Driver



Nov 10, 2017 Output Devices: All output consoles: 80 – 8F: Reserved for future use (new output console codes) 90 – 9F: Input devices: Keyboard/Mouse: A0 – AF: Reserved for future use (new input console codes) B0 – BF: Boot Devices: Includes fixed media and removable media. C0 – CF: Reserved for future use: D0 – DF: Boot device selection: E0 – FF. From the libinput wiki page:. Libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver. It provides device detection, device handling, input device event processing and abstraction so minimize the amount of custom input code compositors need to provide the common set of functionality that users expect. More commonly known as a driver, a device driver or hardware driver is a group of files that enable one or more hardware devices to communicate with the computer's operating system. Without drivers, the computer would not be able to send and receive data correctly to hardware devices, such as a printer. I already found a temporary workaround for this issue myself; I just reinstall the driver (7.35.344.10 - latest I can find) and problem solved. Now, the reason I used 'temporary' is because I do this many times. After reinstalling the driver, about than 2-4 hours later, the problem comes back. This is just too annoying, and very time-consuming.

1.1. The simplest example¶

Here comes a very simple example of an input device driver. The device hasjust one button and the button is accessible at i/o port BUTTON_PORT. Whenpressed or released a BUTTON_IRQ happens. The driver could look like:

1.2. What the example does¶

First it has to include the <linux/input.h> file, which interfaces to theinput subsystem. This provides all the definitions needed.

In the _init function, which is called either upon module load or whenbooting the kernel, it grabs the required resources (it should also checkfor the presence of the device).

Then it allocates a new input device structure with input_allocate_device()and sets up input bitfields. This way the device driver tells the otherparts of the input systems what it is - what events can be generated oraccepted by this input device. Our example device can only generate EV_KEYtype events, and from those only BTN_0 event code. Thus we only set thesetwo bits. We could have used:

as well, but with more than single bits the first approach tends to beshorter.

Then the example driver registers the input device structure by calling:

This adds the button_dev structure to linked lists of the input driver andcalls device handler modules _connect functions to tell them a new inputdevice has appeared. input_register_device() may sleep and therefore mustnot be called from an interrupt or with a spinlock held.

While in use, the only used function of the driver is:

which upon every interrupt from the button checks its state and reports itvia the: Ipmip-gs driver download for windows 8.1.

call to the input system. There is no need to check whether the interruptroutine isn’t reporting two same value events (press, press for example) tothe input system, because the input_report_* functions check thatthemselves.

Then there is the:

call to tell those who receive the events that we’ve sent a complete report.This doesn’t seem important in the one button case, but is quite importantfor for example mouse movement, where you don’t want the X and Y valuesto be interpreted separately, because that’d result in a different movement.

1.3. dev->open() and dev->close()¶

In case the driver has to repeatedly poll the device, because it doesn’thave an interrupt coming from it and the polling is too expensive to be doneall the time, or if the device uses a valuable resource (eg. interrupt), itcan use the open and close callback to know when it can stop polling orrelease the interrupt and when it must resume polling or grab the interruptagain. To do that, we would add this to our example driver:

Note that input core keeps track of number of users for the device andmakes sure that dev->open() is called only when the first user connectsto the device and that dev->close() is called when the very last userdisconnects. Calls to both callbacks are serialized.

The open() callback should return a 0 in case of success or any nonzero valuein case of failure. The close() callback (which is void) must always succeed.

1.4. Basic event types¶

The most simple event type is EV_KEY, which is used for keys and buttons.It’s reported to the input system via:

See uapi/linux/input-event-codes.h for the allowable values of code (from 0 toKEY_MAX). Value is interpreted as a truth value, ie any nonzero value means keypressed, zero value means key released. The input code generates events onlyin case the value is different from before.

In addition to EV_KEY, there are two more basic event types: EV_REL andEV_ABS. They are used for relative and absolute values supplied by thedevice. A relative value may be for example a mouse movement in the X axis.The mouse reports it as a relative difference from the last position,because it doesn’t have any absolute coordinate system to work in. Absoluteevents are namely for joysticks and digitizers - devices that do work in anabsolute coordinate systems.

Having the device report EV_REL buttons is as simple as with EV_KEY, simplyset the corresponding bits and call the:

function. Events are generated only for nonzero value.

However EV_ABS requires a little special care. Before callinginput_register_device, you have to fill additional fields in the input_devstruct for each absolute axis your device has. If our button device had alsothe ABS_X axis:

Input mapper

Or, you can just say:

This setting would be appropriate for a joystick X axis, with the minimum of0, maximum of 255 (which the joystick must be able to reach, no problem ifit sometimes reports more, but it must be able to always reach the min andmax values), with noise in the data up to +- 4, and with a center flatposition of size 8.

If you don’t need absfuzz and absflat, you can set them to zero, which meanthat the thing is precise and always returns to exactly the center position(if it has any).

1.5. BITS_TO_LONGS(), BIT_WORD(), BIT_MASK()¶

These three macros from bitops.h help some bitfield computations:

1.6. The id* and name fields¶

The dev->name should be set before registering the input device by the inputdevice driver. It’s a string like ‘Generic button device’ containing auser friendly name of the device.

The id* fields contain the bus ID (PCI, USB, ..), vendor ID and device IDof the device. The bus IDs are defined in input.h. The vendor and device idsare defined in pci_ids.h, usb_ids.h and similar include files. These fieldsshould be set by the input device driver before registering it.

The idtype field can be used for specific information for the input devicedriver.

The id and name fields can be passed to userland via the evdev interface.

1.7. The keycode, keycodemax, keycodesize fields¶

These three fields should be used by input devices that have dense keymaps.The keycode is an array used to map from scancodes to input system keycodes.The keycode max should contain the size of the array and keycodesize thesize of each entry in it (in bytes).

Userspace can query and alter current scancode to keycode mappings usingEVIOCGKEYCODE and EVIOCSKEYCODE ioctls on corresponding evdev interface.When a device has all 3 aforementioned fields filled in, the driver mayrely on kernel’s default implementation of setting and querying keycodemappings.

1.8. dev->getkeycode() and dev->setkeycode()¶

getkeycode() and setkeycode() callbacks allow drivers to override defaultkeycode/keycodesize/keycodemax mapping mechanism provided by input coreand implement sparse keycode maps.

1.9. Key autorepeat¶

.. is simple. It is handled by the input.c module. Hardware autorepeat isnot used, because it’s not present in many devices and even where it ispresent, it is broken sometimes (at keyboards: Toshiba notebooks). To enableautorepeat for your device, just set EV_REP in dev->evbit. All will behandled by the input system.

1.10. Other event types, handling output events¶

The other event types up to now are:

  • EV_LED - used for the keyboard LEDs.
  • EV_SND - used for keyboard beeps.

They are very similar to for example key events, but they go in the otherdirection - from the system to the input device driver. If your input devicedriver can handle these events, it has to set the respective bits in evbit,and also the callback routine:

This callback routine can be called from an interrupt or a BH (although thatisn’t a rule), and thus must not sleep, and must not take too long to finish.

From the libinput wiki page:

libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver. It provides device detection, device handling, input device event processing and abstraction so minimize the amount of custom input code compositors need to provide the common set of functionality that users expect.

The X.Org input driver supports most regular Xorg#Input devices. Particularly notable is the project's goal to provide advanced support for touch (multitouch and gesture) features of touchpads and touchscreens. See the libinput documentation for more information.

Installation

If you wish to use libinput under Wayland, there is nothing to do for installation. The libinput package should already be installed as a dependency of any graphical environment you use that has Wayland, and no additional driver is needed.

Ge Camera Driver free download - Driver Easy, EOCP Driver for Sony Eyetoy USB Camera, Magic Camera, and many more programs. Ge security driver download for windows 7. Ge Security Camera Software Home Security Camera v.6.3 Home Security Camera is flexible and sophisticated Video Management Software loaded on your computer and allows you to view multiple cameras, record and retrieve video, and monitor alarms.

If you wish to use libinput with Xorg, install the xf86-input-libinput package, which is 'a thin wrapper around libinput and allows for libinput to be used for input devices in X. This driver can be used as as drop-in replacement for evdev and synaptics.' [1] In other words, other packages used for input with X (i.e., those prefixed with xf86-input-) can be replaced with this driver.

You may also want to install xorg-xinput to be able to change settings at runtime.

Configuration

For Wayland, there is no libinput configuration file. The configurable options depend on the progress of your desktop environment's support for them; see #Graphical tools.

For Xorg, a default configuration file for the wrapper is installed to /usr/share/X11/xorg.conf.d/40-libinput.conf. No extra configuration is necessary for it to autodetect keyboards, touchpads, trackpointers and supported touchscreens.

Via xinput

First, execute:

It will output the devices on the system and their respective features supported by libinput.

After a restart of the graphical environment, the devices should be managed by libinput with default configuration, if no other drivers are configured to take precedence.

See libinput(4) for general options to set and information about allowable values. The xinput tool is used to view or change options available for a particular device at runtime. For example:

to view all devices and determine their names and numbers. In the following, device is either the name or number identifying the device to operate with.

to view and

to change a setting. option can be either the number or the name of the option. For example, to set both options of libinput Click Method Enabled (303), either of the following can be issued:

or

Via Xorg configuration file

See Xorg#Using .conf files for permanent option settings. Logitech Marble Mouse#libinput and #Button re-mapping illustrate examples.

Alternative drivers for Xorg#Input devices can generally be installed in parallel. If you intend to switch driver for a device to use libinput, ensure no legacy configuration files /etc/X11/xorg.conf.d/ for other drivers take precedence.

Tip: If you have libinput and synaptics installed in parallel with default configuration (i.e. no files in /etc/X11/xorg.conf.d for either), synaptics will take precedence due to its higher numeric order 70- in the default installation directory. To avoid this, you can symlink the default libinput configuration (40-libinput.conf) to /etc/X11/xorg.conf.d/ where directory search order precedence over 70-synaptics.conf will take place instead:If you do have /etc/X11/xorg.conf.d/ configuration files for both, the libinput file must be ordered second; see Xorg#Using .conf files. If you want to disable libinput (and fallback to older drivers) - just remove the previously created symbolic link from /etc/X11/xorg.conf.d/.
Tip: If a configuration file seems to have no effect at all, check that it is readable by unprivileged users.

One way to check which devices are managed by libinput is the xorg logfile. For example, the following:

is a notebook without any configuration files in /etc/X11/xorg.conf.d/, i.e. devices are autodetected.

Of course you can elect to use an alternative driver for one device and libinput for others. A number of factors may influence which driver to use. For example, in comparison to Touchpad Synaptics the libinput driver has fewer options to customize touchpad behaviour to one's own taste, but far more programmatic logic to process multitouch events (e.g. palm detection as well). Hence, it makes sense to try the alternative, if you are experiencing problems on your hardware with one driver or the other.

Custom configuration files should be placed in /etc/X11/xorg.conf.d/ and following a widely used naming schema 30-touchpad.conf is often chosen as filename.

Output Devices

Tip: Have a look at CONFIGURATION DETAILS in /usr/share/X11/xorg.conf.d/40-libinput.conf for guidance and refer to the libinput(4) manual page for a detailed description of available configuration options.

A basic configuration should have the following structure:

Insyde Input Devices DriverInsyde

You may define as many sections as you like in a single configuration file (usually one per input device).To configure the device of your choice specify a filter by using one of the filters in the INPUTCLASS SECTION xorg.conf(5), e.g.

  • MatchIsPointer 'on' (trackpoint)
  • MatchIsKeyboard 'on'
  • MatchIsTouchpad 'on'
  • MatchIsTouchscreen 'on'

The input device can then be configured with any of the lines in the CONFIGURATION DETAILS section of libinput(4). Common options include:

  • Option 'Tapping' 'on': tapping a.k.a. tap-to-click
  • Option 'ClickMethod' 'clickfinger': trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the docs.
  • Option 'NaturalScrolling' 'true': natural (reverse) scrolling
  • Option 'ScrollMethod' 'edge': edge (vertical) scrolling

Bear in mind that some of them may only apply to certain devices and you will need to restart X for changes to take effect.

Graphical tools

There are different GUI tools:

  • GNOME:
    • Control center has a basic UI. See GNOME#Mouse and touchpad.
    • gnome-tweaks offers some additional settings.
  • Cinnamon:
    • Similar to the GNOME UI, with more options.
  • KDE Plasma 5:
    • Keyboard, mouse and controller devices can be configured from System Settings.
  • Xfce:
    • Configured from the Mouse and Touchpad submenu in xfce4-settings.

Tips and tricks

Button re-mapping

Swapping two- and three-finger tap for a touchpad is a straight forward example. Instead of the default three-finger tap for pasting you can configure two-finger tap pasting by setting the TappingButtonMap option in your Xorg configuration file. To set 1/2/3-finger taps to left/right/middle set TappingButtonMap to lrm, for left/middle/right set it to lmr.

Remember to remove MatchIsTouchpad 'on' if your device is not a touchpad and adjust the Identifier accordingly.

Manual button re-mapping

For some devices it is desirable to change the button mapping. A common example is the use of a thumb button instead of the middle button (used in X11 for pasting) on mice where the middle button is part of the mouse wheel. You can query the current button mapping via:

where device is either the device name or the device ID, as returned by xinput list. You can freely permutate the button numbers and write them back. Example:

In this example, we mapped button 6 to be the middle button and disabled the original middle button by assigning it to button 0. This may also be used for Wayland, but be aware both the device number and its button-map will be different. Hence, settings are not directly interchangeable.

Tip: You can use xev (from the xorg-xev package) to find out which physical button is currently mapped to which ID.

Some devices occur several times under the same device name, with a different amount of buttons exposed. The following is an example for reliably changing the button mapping for a Logitech Revolution MX mouse via xinitrc:

Change touchpad sensitivity

The method of finding the correct thresholds for when libinput registers a touch as DOWN and back UP again can be found [2] in the upstream documentation.

Custom touchpad pressure values can be set via temporary local device quirks. See [3].

Insyde Input Devices Driver Updater

Note: Quirks are an internal API and are not guaranteed to work in future libinput versions. Between versions 1.11 and 1.12, udev rules [4] were replaced by .quirk files [5].

Disable touchpad

To disable the touchpad, first get its name with xinput list and then disable it with xinput disable name.

Note:
  • It is more robust to disable it by name than by ID number. The devices may be renumbered.
  • It will be necessary to quote the name if it contains spaces.

To make it permanent, see Autostarting.

To toggle, write a script such as [6].

Gestures

While the libinput driver already contains logic to process advanced multitouch events like swipe and pinch gestures, the Desktop environment or Window manager might not have implemented actions for all of them yet.

libinput-gestures

For EWMH (see also wm-spec) compliant window managers, the libinput-gestures utility can be used meanwhile. The program reads libinput gestures (through libinput debug-events) from the touchpad and maps them to gestures according to a configuration file. Hence, it offers some flexibility within the boundaries of libinput's built-in recognition.

To use it, install the libinput-gesturesAUR package. You can use the default system-wide configured swipe and pinch gestures or define your own in a personal configuration file, see the README for details.

fusuma

Fusuma is a multitouch gesture recognizer, written in Ruby, which can be used as an alternative to libinput-gestures.

Install the fusumaRuby gem:

Alternatively, there is also ruby-fusumaAUR.

Other than the fusumaRuby gem gem you have to install the fusuma-plugin-sendkeyRuby gem or one between the xdotool (for X) and ydotoolAUR (for Wayland). Other alternatives are listed here.

Tip: The fusuma-plugin-sendkeyRuby gem supports both X and Wayland

Then in ~/.config/fusuma/config.yml you have to set something like:

Or for xdotool:

Same thing for ydotool.

The swipe threshold is important for not swiping back too many pages.

Notice that the config is for three fingers swipe. Two fingers swipe is not supported [7].

Gebaar

Gebaar is another gesture recognizer.Unlike Fusuma, it doesn't support pinching (support is planned in the future though) and threshholds, but in addition to swiping left, right, up and down with 3/4 fingers, it also supports diagonal swipes, which Fusuma does not.

There is a fork of gebaar at Gebaar which could be installed through gebaar-libinput-gitAUR which supports pinch gestures and adds additional features to original gebaar. Take in mind that this version is currently under active development and introduces config changes which makes it incompatable to original Gebaar

GnomeExtendedGestures

For deeper integration with GNOME, there is GnomeExtendedGestures (gnome-shell-extension-extended-gestures-gitAUR). Three finger horizontal and vertical gestures can be configured to perform gnome-shell actions (such as toggling the application overview or cycling between them).

Scroll with mouse by holding a button

There is a nice trick to optimize scrolling with a mouse or trackball by holding a mouse button (like right or middle button, or some other if the mouse has more buttons) and moving the mouse. Very useful in case your mouse does not have the mouse wheel (often the case with the trackballs). To do that one has to set ScrollMethod to button and specify the mouse button in the ScrollButton option for the action. Here is an example for configuration to achieve that:

Mouse wheel scrolling speed scaling

For some mouses, especially when using on a HiDPI desktop, the wheel scrolls too slow. A patch is submitted to libinput but it hasn't been accepted. There is a third-party xf86-input-libinput that incoperates this patch.

This patch introduces a new property libinput Scroll Distance Scale to mouses, and you can set a scaling factor like

where the RAPOO Rapoo 2.4G Wireless Device is the name of your mouse device, listed in xinput --list. 2.5 2.5 are the scaling factors, for x- and y-axis, respectively.

Alternatively, install libinput-multiplierAUR and restart Xorg, then enlarge y-axis scroll distance to 6 times by

Here is an example to modify the scaling factor upon focusing change

Troubleshooting

First, see whether executing libinput debug-events can support you in debugging the problem, see libinput-debug-events(1) for options.

Some inputs require kernel support. The tool evemu-describe from the evemu package can be used to check:

Compare the output of software supported input trackpad driver with a supported trackpad. i.e. a couple of ABS_ axes, a couple of ABS_MT axes and no REL_X/Y axis. For a clickpad the INPUT_PROP_BUTTONPAD property should also be set, if it is supported.

Touchpad not working in GNOME

Ensure the touchpad events are being sent to the GNOME desktop by running the following command:

Additionally, GNOME may override certain behaviors, like turning off Tapping and forcing Natural Scrolling. In this case the settings must be adapted using GNOMEs gsettings command line tool or a graphical frontend of your choice. For example if you wish to enable Tapping and disable Natural Scrolling for your user, adjust the touchpad key-values like the following:

See also

  • FOSDEM 2015 - libinput - Hans de Goede on goals and plans of the project
  • Peter Hutterer's Blog - numerous posts on libinput from one of the project's hackers
Retrieved from 'https://wiki.archlinux.org/index.php?title=Libinput&oldid=650211'