[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/lib/libinput][upstream-unstable] 6 commits: Add original MX Master to inverted-horizontal-wheel-having mice.



Title: GitLab

Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / lib / libinput

Commits:

9 changed files:

Changes:

  • include/linux/freebsd/input-event-codes.h
    1
    -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
    
    1
    +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
    
    2 2
     /*
    
    3 3
      * Input event codes
    
    4 4
      *
    
    ... ... @@ -439,10 +439,12 @@
    439 439
     #define KEY_TITLE		0x171
    
    440 440
     #define KEY_SUBTITLE		0x172
    
    441 441
     #define KEY_ANGLE		0x173
    
    442
    -#define KEY_ZOOM		0x174
    
    442
    +#define KEY_FULL_SCREEN		0x174	/* AC View Toggle */
    
    443
    +#define KEY_ZOOM		KEY_FULL_SCREEN
    
    443 444
     #define KEY_MODE		0x175
    
    444 445
     #define KEY_KEYBOARD		0x176
    
    445
    -#define KEY_SCREEN		0x177
    
    446
    +#define KEY_ASPECT_RATIO	0x177	/* HUTRR37: Aspect */
    
    447
    +#define KEY_SCREEN		KEY_ASPECT_RATIO
    
    446 448
     #define KEY_PC			0x178	/* Media Select Computer */
    
    447 449
     #define KEY_TV			0x179	/* Media Select TV */
    
    448 450
     #define KEY_TV2			0x17a	/* Media Select Cable */
    
    ... ... @@ -604,6 +606,7 @@
    604 606
     #define KEY_SCREENSAVER		0x245	/* AL Screen Saver */
    
    605 607
     #define KEY_VOICECOMMAND		0x246	/* Listening Voice Command */
    
    606 608
     #define KEY_ASSISTANT		0x247	/* AL Context-aware desktop assistant */
    
    609
    +#define KEY_KBD_LAYOUT_NEXT	0x248	/* AC Next Keyboard Layout Select */
    
    607 610
     
    
    608 611
     #define KEY_BRIGHTNESS_MIN		0x250	/* Set Brightness to Minimum */
    
    609 612
     #define KEY_BRIGHTNESS_MAX		0x251	/* Set Brightness to Maximum */
    
    ... ... @@ -646,6 +649,86 @@
    646 649
      */
    
    647 650
     #define KEY_DATA			0x277
    
    648 651
     #define KEY_ONSCREEN_KEYBOARD		0x278
    
    652
    +/* Electronic privacy screen control */
    
    653
    +#define KEY_PRIVACY_SCREEN_TOGGLE	0x279
    
    654
    +
    
    655
    +/* Select an area of screen to be copied */
    
    656
    +#define KEY_SELECTIVE_SCREENSHOT	0x27a
    
    657
    +
    
    658
    +/*
    
    659
    + * Some keyboards have keys which do not have a defined meaning, these keys
    
    660
    + * are intended to be programmed / bound to macros by the user. For most
    
    661
    + * keyboards with these macro-keys the key-sequence to inject, or action to
    
    662
    + * take, is all handled by software on the host side. So from the kernel's
    
    663
    + * point of view these are just normal keys.
    
    664
    + *
    
    665
    + * The KEY_MACRO# codes below are intended for such keys, which may be labeled
    
    666
    + * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
    
    667
    + * where the marking on the key does indicate a defined meaning / purpose.
    
    668
    + *
    
    669
    + * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
    
    670
    + * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
    
    671
    + * define MUST be added.
    
    672
    + */
    
    673
    +#define KEY_MACRO1			0x290
    
    674
    +#define KEY_MACRO2			0x291
    
    675
    +#define KEY_MACRO3			0x292
    
    676
    +#define KEY_MACRO4			0x293
    
    677
    +#define KEY_MACRO5			0x294
    
    678
    +#define KEY_MACRO6			0x295
    
    679
    +#define KEY_MACRO7			0x296
    
    680
    +#define KEY_MACRO8			0x297
    
    681
    +#define KEY_MACRO9			0x298
    
    682
    +#define KEY_MACRO10			0x299
    
    683
    +#define KEY_MACRO11			0x29a
    
    684
    +#define KEY_MACRO12			0x29b
    
    685
    +#define KEY_MACRO13			0x29c
    
    686
    +#define KEY_MACRO14			0x29d
    
    687
    +#define KEY_MACRO15			0x29e
    
    688
    +#define KEY_MACRO16			0x29f
    
    689
    +#define KEY_MACRO17			0x2a0
    
    690
    +#define KEY_MACRO18			0x2a1
    
    691
    +#define KEY_MACRO19			0x2a2
    
    692
    +#define KEY_MACRO20			0x2a3
    
    693
    +#define KEY_MACRO21			0x2a4
    
    694
    +#define KEY_MACRO22			0x2a5
    
    695
    +#define KEY_MACRO23			0x2a6
    
    696
    +#define KEY_MACRO24			0x2a7
    
    697
    +#define KEY_MACRO25			0x2a8
    
    698
    +#define KEY_MACRO26			0x2a9
    
    699
    +#define KEY_MACRO27			0x2aa
    
    700
    +#define KEY_MACRO28			0x2ab
    
    701
    +#define KEY_MACRO29			0x2ac
    
    702
    +#define KEY_MACRO30			0x2ad
    
    703
    +
    
    704
    +/*
    
    705
    + * Some keyboards with the macro-keys described above have some extra keys
    
    706
    + * for controlling the host-side software responsible for the macro handling:
    
    707
    + * -A macro recording start/stop key. Note that not all keyboards which emit
    
    708
    + *  KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
    
    709
    + *  KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START
    
    710
    + *  should be interpreted as a recording start/stop toggle;
    
    711
    + * -Keys for switching between different macro (pre)sets, either a key for
    
    712
    + *  cycling through the configured presets or keys to directly select a preset.
    
    713
    + */
    
    714
    +#define KEY_MACRO_RECORD_START		0x2b0
    
    715
    +#define KEY_MACRO_RECORD_STOP		0x2b1
    
    716
    +#define KEY_MACRO_PRESET_CYCLE		0x2b2
    
    717
    +#define KEY_MACRO_PRESET1		0x2b3
    
    718
    +#define KEY_MACRO_PRESET2		0x2b4
    
    719
    +#define KEY_MACRO_PRESET3		0x2b5
    
    720
    +
    
    721
    +/*
    
    722
    + * Some keyboards have a buildin LCD panel where the contents are controlled
    
    723
    + * by the host. Often these have a number of keys directly below the LCD
    
    724
    + * intended for controlling a menu shown on the LCD. These keys often don't
    
    725
    + * have any labeling so we just name them KEY_KBD_LCD_MENU#
    
    726
    + */
    
    727
    +#define KEY_KBD_LCD_MENU1		0x2b8
    
    728
    +#define KEY_KBD_LCD_MENU2		0x2b9
    
    729
    +#define KEY_KBD_LCD_MENU3		0x2ba
    
    730
    +#define KEY_KBD_LCD_MENU4		0x2bb
    
    731
    +#define KEY_KBD_LCD_MENU5		0x2bc
    
    649 732
     
    
    650 733
     #define BTN_TRIGGER_HAPPY		0x2c0
    
    651 734
     #define BTN_TRIGGER_HAPPY1		0x2c0
    
    ... ... @@ -805,7 +888,8 @@
    805 888
     #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
    
    806 889
     #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
    
    807 890
     #define SW_PEN_INSERTED		0x0f  /* set = pen inserted */
    
    808
    -#define SW_MAX			0x0f
    
    891
    +#define SW_MACHINE_COVER	0x10  /* set = cover closed */
    
    892
    +#define SW_MAX			0x10
    
    809 893
     #define SW_CNT			(SW_MAX+1)
    
    810 894
     
    
    811 895
     /*
    

  • include/linux/linux/input-event-codes.h
    1
    -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
    
    1
    +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
    
    2 2
     /*
    
    3 3
      * Input event codes
    
    4 4
      *
    
    ... ... @@ -439,10 +439,12 @@
    439 439
     #define KEY_TITLE		0x171
    
    440 440
     #define KEY_SUBTITLE		0x172
    
    441 441
     #define KEY_ANGLE		0x173
    
    442
    -#define KEY_ZOOM		0x174
    
    442
    +#define KEY_FULL_SCREEN		0x174	/* AC View Toggle */
    
    443
    +#define KEY_ZOOM		KEY_FULL_SCREEN
    
    443 444
     #define KEY_MODE		0x175
    
    444 445
     #define KEY_KEYBOARD		0x176
    
    445
    -#define KEY_SCREEN		0x177
    
    446
    +#define KEY_ASPECT_RATIO	0x177	/* HUTRR37: Aspect */
    
    447
    +#define KEY_SCREEN		KEY_ASPECT_RATIO
    
    446 448
     #define KEY_PC			0x178	/* Media Select Computer */
    
    447 449
     #define KEY_TV			0x179	/* Media Select TV */
    
    448 450
     #define KEY_TV2			0x17a	/* Media Select Cable */
    
    ... ... @@ -604,6 +606,7 @@
    604 606
     #define KEY_SCREENSAVER		0x245	/* AL Screen Saver */
    
    605 607
     #define KEY_VOICECOMMAND		0x246	/* Listening Voice Command */
    
    606 608
     #define KEY_ASSISTANT		0x247	/* AL Context-aware desktop assistant */
    
    609
    +#define KEY_KBD_LAYOUT_NEXT	0x248	/* AC Next Keyboard Layout Select */
    
    607 610
     
    
    608 611
     #define KEY_BRIGHTNESS_MIN		0x250	/* Set Brightness to Minimum */
    
    609 612
     #define KEY_BRIGHTNESS_MAX		0x251	/* Set Brightness to Maximum */
    
    ... ... @@ -646,6 +649,86 @@
    646 649
      */
    
    647 650
     #define KEY_DATA			0x277
    
    648 651
     #define KEY_ONSCREEN_KEYBOARD		0x278
    
    652
    +/* Electronic privacy screen control */
    
    653
    +#define KEY_PRIVACY_SCREEN_TOGGLE	0x279
    
    654
    +
    
    655
    +/* Select an area of screen to be copied */
    
    656
    +#define KEY_SELECTIVE_SCREENSHOT	0x27a
    
    657
    +
    
    658
    +/*
    
    659
    + * Some keyboards have keys which do not have a defined meaning, these keys
    
    660
    + * are intended to be programmed / bound to macros by the user. For most
    
    661
    + * keyboards with these macro-keys the key-sequence to inject, or action to
    
    662
    + * take, is all handled by software on the host side. So from the kernel's
    
    663
    + * point of view these are just normal keys.
    
    664
    + *
    
    665
    + * The KEY_MACRO# codes below are intended for such keys, which may be labeled
    
    666
    + * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
    
    667
    + * where the marking on the key does indicate a defined meaning / purpose.
    
    668
    + *
    
    669
    + * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
    
    670
    + * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
    
    671
    + * define MUST be added.
    
    672
    + */
    
    673
    +#define KEY_MACRO1			0x290
    
    674
    +#define KEY_MACRO2			0x291
    
    675
    +#define KEY_MACRO3			0x292
    
    676
    +#define KEY_MACRO4			0x293
    
    677
    +#define KEY_MACRO5			0x294
    
    678
    +#define KEY_MACRO6			0x295
    
    679
    +#define KEY_MACRO7			0x296
    
    680
    +#define KEY_MACRO8			0x297
    
    681
    +#define KEY_MACRO9			0x298
    
    682
    +#define KEY_MACRO10			0x299
    
    683
    +#define KEY_MACRO11			0x29a
    
    684
    +#define KEY_MACRO12			0x29b
    
    685
    +#define KEY_MACRO13			0x29c
    
    686
    +#define KEY_MACRO14			0x29d
    
    687
    +#define KEY_MACRO15			0x29e
    
    688
    +#define KEY_MACRO16			0x29f
    
    689
    +#define KEY_MACRO17			0x2a0
    
    690
    +#define KEY_MACRO18			0x2a1
    
    691
    +#define KEY_MACRO19			0x2a2
    
    692
    +#define KEY_MACRO20			0x2a3
    
    693
    +#define KEY_MACRO21			0x2a4
    
    694
    +#define KEY_MACRO22			0x2a5
    
    695
    +#define KEY_MACRO23			0x2a6
    
    696
    +#define KEY_MACRO24			0x2a7
    
    697
    +#define KEY_MACRO25			0x2a8
    
    698
    +#define KEY_MACRO26			0x2a9
    
    699
    +#define KEY_MACRO27			0x2aa
    
    700
    +#define KEY_MACRO28			0x2ab
    
    701
    +#define KEY_MACRO29			0x2ac
    
    702
    +#define KEY_MACRO30			0x2ad
    
    703
    +
    
    704
    +/*
    
    705
    + * Some keyboards with the macro-keys described above have some extra keys
    
    706
    + * for controlling the host-side software responsible for the macro handling:
    
    707
    + * -A macro recording start/stop key. Note that not all keyboards which emit
    
    708
    + *  KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
    
    709
    + *  KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START
    
    710
    + *  should be interpreted as a recording start/stop toggle;
    
    711
    + * -Keys for switching between different macro (pre)sets, either a key for
    
    712
    + *  cycling through the configured presets or keys to directly select a preset.
    
    713
    + */
    
    714
    +#define KEY_MACRO_RECORD_START		0x2b0
    
    715
    +#define KEY_MACRO_RECORD_STOP		0x2b1
    
    716
    +#define KEY_MACRO_PRESET_CYCLE		0x2b2
    
    717
    +#define KEY_MACRO_PRESET1		0x2b3
    
    718
    +#define KEY_MACRO_PRESET2		0x2b4
    
    719
    +#define KEY_MACRO_PRESET3		0x2b5
    
    720
    +
    
    721
    +/*
    
    722
    + * Some keyboards have a buildin LCD panel where the contents are controlled
    
    723
    + * by the host. Often these have a number of keys directly below the LCD
    
    724
    + * intended for controlling a menu shown on the LCD. These keys often don't
    
    725
    + * have any labeling so we just name them KEY_KBD_LCD_MENU#
    
    726
    + */
    
    727
    +#define KEY_KBD_LCD_MENU1		0x2b8
    
    728
    +#define KEY_KBD_LCD_MENU2		0x2b9
    
    729
    +#define KEY_KBD_LCD_MENU3		0x2ba
    
    730
    +#define KEY_KBD_LCD_MENU4		0x2bb
    
    731
    +#define KEY_KBD_LCD_MENU5		0x2bc
    
    649 732
     
    
    650 733
     #define BTN_TRIGGER_HAPPY		0x2c0
    
    651 734
     #define BTN_TRIGGER_HAPPY1		0x2c0
    
    ... ... @@ -805,7 +888,8 @@
    805 888
     #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
    
    806 889
     #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
    
    807 890
     #define SW_PEN_INSERTED		0x0f  /* set = pen inserted */
    
    808
    -#define SW_MAX			0x0f
    
    891
    +#define SW_MACHINE_COVER	0x10  /* set = cover closed */
    
    892
    +#define SW_MAX			0x10
    
    809 893
     #define SW_CNT			(SW_MAX+1)
    
    810 894
     
    
    811 895
     /*
    

  • meson.build
    1 1
     project('libinput', 'c',
    
    2
    -	version : '1.16.0',
    
    2
    +	version : '1.16.1',
    
    3 3
     	license : 'MIT/Expat',
    
    4 4
     	default_options : [ 'c_std=gnu99', 'warning_level=2' ],
    
    5 5
     	meson_version : '>= 0.45.0')
    
    ... ... @@ -785,6 +785,7 @@ if get_option('tests')
    785 785
     		'test/litest-device-keyboard-razer-blade-stealth-videoswitch.c',
    
    786 786
     		'test/litest-device-lid-switch.c',
    
    787 787
     		'test/litest-device-lid-switch-surface3.c',
    
    788
    +		'test/litest-device-logitech-media-keyboard-elite.c',
    
    788 789
     		'test/litest-device-logitech-trackball.c',
    
    789 790
     		'test/litest-device-nexus4-touch-screen.c',
    
    790 791
     		'test/litest-device-magic-trackpad.c',
    
    ... ... @@ -798,6 +799,7 @@ if get_option('tests')
    798 799
     		'test/litest-device-ms-surface-cover.c',
    
    799 800
     		'test/litest-device-protocol-a-touch-screen.c',
    
    800 801
     		'test/litest-device-qemu-usb-tablet.c',
    
    802
    +		'test/litest-device-sony-vaio-keys.c',
    
    801 803
     		'test/litest-device-synaptics-x220.c',
    
    802 804
     		'test/litest-device-synaptics-hover.c',
    
    803 805
     		'test/litest-device-synaptics-i2c.c',
    

  • quirks/30-vendor-logitech.quirks
    ... ... @@ -46,6 +46,33 @@ MatchVendor=0x046D
    46 46
     MatchProduct=0x4011
    
    47 47
     AttrPalmPressureThreshold=400
    
    48 48
     
    
    49
    +[Logitech MX Master]
    
    50
    +MatchVendor=0x46D
    
    51
    +MatchProduct=0x4041
    
    52
    +ModelInvertHorizontalScrolling=1
    
    53
    +[Logitech MX Master]
    
    54
    +MatchVendor=0x46D
    
    55
    +MatchProduct=0x4060
    
    56
    +ModelInvertHorizontalScrolling=1
    
    57
    +[Logitech MX Master]
    
    58
    +MatchVendor=0x46D
    
    59
    +MatchProduct=0x4071
    
    60
    +ModelInvertHorizontalScrolling=1
    
    61
    +
    
    62
    +# MX Master has a different PID on bluetooth
    
    63
    +[Logitech MX Master]
    
    64
    +MatchVendor=0x46D
    
    65
    +MatchProduct=0xB012
    
    66
    +ModelInvertHorizontalScrolling=1
    
    67
    +[Logitech MX Master]
    
    68
    +MatchVendor=0x46D
    
    69
    +MatchProduct=0xB017
    
    70
    +ModelInvertHorizontalScrolling=1
    
    71
    +[Logitech MX Master]
    
    72
    +MatchVendor=0x46D
    
    73
    +MatchProduct=0xB01E
    
    74
    +ModelInvertHorizontalScrolling=1
    
    75
    +
    
    49 76
     [Logitech MX Master 2S]
    
    50 77
     MatchVendor=0x46D
    
    51 78
     MatchProduct=0x4069
    

  • src/evdev.c
    ... ... @@ -1810,8 +1810,9 @@ evdev_configure_device(struct evdev_device *device)
    1810 1810
     		evdev_disable_accelerometer_axes(device);
    
    1811 1811
     	}
    
    1812 1812
     
    
    1813
    -	if (udev_tags & EVDEV_UDEV_TAG_JOYSTICK) {
    
    1814
    -		evdev_log_info(device, "device is a joystick, ignoring\n");
    
    1813
    +	if (udev_tags == (EVDEV_UDEV_TAG_INPUT|EVDEV_UDEV_TAG_JOYSTICK)) {
    
    1814
    +		evdev_log_info(device,
    
    1815
    +			       "device is a joystick, ignoring\n");
    
    1815 1816
     		return NULL;
    
    1816 1817
     	}
    
    1817 1818
     
    

  • test/litest-device-logitech-media-keyboard-elite.c
    1
    +/*
    
    2
    + * Copyright © 2020 Red Hat, Inc.
    
    3
    + *
    
    4
    + * Permission is hereby granted, free of charge, to any person obtaining a
    
    5
    + * copy of this software and associated documentation files (the "Software"),
    
    6
    + * to deal in the Software without restriction, including without limitation
    
    7
    + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    
    8
    + * and/or sell copies of the Software, and to permit persons to whom the
    
    9
    + * Software is furnished to do so, subject to the following conditions:
    
    10
    + *
    
    11
    + * The above copyright notice and this permission notice (including the next
    
    12
    + * paragraph) shall be included in all copies or substantial portions of the
    
    13
    + * Software.
    
    14
    + *
    
    15
    + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    
    16
    + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    
    17
    + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    
    18
    + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    
    19
    + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    
    20
    + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    
    21
    + * DEALINGS IN THE SOFTWARE.
    
    22
    + */
    
    23
    +
    
    24
    +#include "config.h"
    
    25
    +
    
    26
    +#include <assert.h>
    
    27
    +
    
    28
    +#include "libinput-util.h"
    
    29
    +
    
    30
    +#include "litest.h"
    
    31
    +#include "litest-int.h"
    
    32
    +
    
    33
    +/* Description taken from
    
    34
    + * https://gitlab.freedesktop.org/libinput/libinput/-/issues/514
    
    35
    + */
    
    36
    +
    
    37
    +static struct input_id input_id = {
    
    38
    +	.bustype = 0x3,
    
    39
    +	.vendor = 0x46d,
    
    40
    +	.product = 0x30f,
    
    41
    +};
    
    42
    +
    
    43
    +static int events[] = {
    
    44
    +	EV_KEY, KEY_MUTE,
    
    45
    +	EV_KEY, KEY_VOLUMEDOWN,
    
    46
    +	EV_KEY, KEY_VOLUMEUP,
    
    47
    +	EV_KEY, KEY_UNDO,
    
    48
    +	EV_KEY, KEY_HELP,
    
    49
    +	EV_KEY, KEY_CALC,
    
    50
    +	EV_KEY, KEY_MAIL,
    
    51
    +	EV_KEY, KEY_BOOKMARKS,
    
    52
    +	EV_KEY, KEY_BACK,
    
    53
    +	EV_KEY, KEY_FORWARD,
    
    54
    +	EV_KEY, KEY_NEXTSONG,
    
    55
    +	EV_KEY, KEY_PLAYPAUSE,
    
    56
    +	EV_KEY, KEY_PREVIOUSSONG,
    
    57
    +	EV_KEY, KEY_STOPCD,
    
    58
    +	EV_KEY, KEY_REWIND,
    
    59
    +	EV_KEY, KEY_CONFIG,
    
    60
    +	EV_KEY, KEY_HOMEPAGE,
    
    61
    +	EV_KEY, KEY_REDO,
    
    62
    +	EV_KEY, KEY_FASTFORWARD,
    
    63
    +	EV_KEY, KEY_PRINT,
    
    64
    +	EV_KEY, KEY_SEARCH,
    
    65
    +	EV_KEY, KEY_SAVE,
    
    66
    +	EV_KEY, 319,
    
    67
    +	EV_KEY, BTN_TOOL_QUINTTAP,
    
    68
    +	EV_KEY, BTN_STYLUS3,
    
    69
    +	EV_KEY, BTN_TOUCH,
    
    70
    +	EV_KEY, BTN_STYLUS,
    
    71
    +	EV_KEY, KEY_ZOOMIN,
    
    72
    +	EV_KEY, KEY_ZOOMOUT,
    
    73
    +	EV_KEY, KEY_ZOOMRESET,
    
    74
    +	EV_KEY, KEY_WORDPROCESSOR,
    
    75
    +	EV_KEY, KEY_SPREADSHEET,
    
    76
    +	EV_KEY, KEY_PRESENTATION,
    
    77
    +	EV_KEY, KEY_MESSENGER,
    
    78
    +
    
    79
    +	EV_MSC, MSC_SCAN,
    
    80
    +	-1, -1,
    
    81
    +};
    
    82
    +
    
    83
    +TEST_DEVICE("logitech-media-keyboard-elite",
    
    84
    +	.type = LITEST_KEYBOARD_LOGITECH_MEDIA_KEYBOARD_ELITE,
    
    85
    +	.features = LITEST_KEYS,
    
    86
    +	.interface = NULL,
    
    87
    +
    
    88
    +	.name = "Logitech Logitech USB Keyboard Consumer Control",
    
    89
    +	.id = &input_id,
    
    90
    +	.events = events,
    
    91
    +	.absinfo = NULL,
    
    92
    +)

  • test/litest-device-sony-vaio-keys.c
    1
    +/*
    
    2
    + * Copyright © 2020 Red Hat, Inc.
    
    3
    + *
    
    4
    + * Permission is hereby granted, free of charge, to any person obtaining a
    
    5
    + * copy of this software and associated documentation files (the "Software"),
    
    6
    + * to deal in the Software without restriction, including without limitation
    
    7
    + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    
    8
    + * and/or sell copies of the Software, and to permit persons to whom the
    
    9
    + * Software is furnished to do so, subject to the following conditions:
    
    10
    + *
    
    11
    + * The above copyright notice and this permission notice (including the next
    
    12
    + * paragraph) shall be included in all copies or substantial portions of the
    
    13
    + * Software.
    
    14
    + *
    
    15
    + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    
    16
    + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    
    17
    + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    
    18
    + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    
    19
    + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    
    20
    + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    
    21
    + * DEALINGS IN THE SOFTWARE.
    
    22
    + */
    
    23
    +
    
    24
    +#include "config.h"
    
    25
    +
    
    26
    +#include <assert.h>
    
    27
    +
    
    28
    +#include "libinput-util.h"
    
    29
    +
    
    30
    +#include "litest.h"
    
    31
    +#include "litest-int.h"
    
    32
    +
    
    33
    +/* Description taken from
    
    34
    + * https://gitlab.freedesktop.org/libinput/libinput/-/issues/515
    
    35
    + */
    
    36
    +
    
    37
    +static struct input_id input_id = {
    
    38
    +	.bustype = 0x10,
    
    39
    +	.vendor = 0x104d,
    
    40
    +	.product = 0x00,
    
    41
    +};
    
    42
    +
    
    43
    +static int events[] = {
    
    44
    +	EV_KEY, KEY_UP,
    
    45
    +	EV_KEY, KEY_DOWN,
    
    46
    +	EV_KEY, KEY_MUTE,
    
    47
    +	EV_KEY, KEY_VOLUMEDOWN,
    
    48
    +	EV_KEY, KEY_VOLUMEUP,
    
    49
    +	EV_KEY, KEY_HELP,
    
    50
    +	EV_KEY, KEY_PROG1,
    
    51
    +	EV_KEY, KEY_PROG2,
    
    52
    +	EV_KEY, KEY_BACK,
    
    53
    +	EV_KEY, KEY_EJECTCD,
    
    54
    +	EV_KEY, KEY_F13,
    
    55
    +	EV_KEY, KEY_F14,
    
    56
    +	EV_KEY, KEY_F15,
    
    57
    +	EV_KEY, KEY_F21,
    
    58
    +	EV_KEY, KEY_PROG3,
    
    59
    +	EV_KEY, KEY_PROG4,
    
    60
    +	EV_KEY, KEY_SUSPEND,
    
    61
    +	EV_KEY, KEY_CAMERA,
    
    62
    +	EV_KEY, KEY_BRIGHTNESSDOWN,
    
    63
    +	EV_KEY, KEY_BRIGHTNESSUP,
    
    64
    +	EV_KEY, KEY_MEDIA,
    
    65
    +	EV_KEY, KEY_SWITCHVIDEOMODE,
    
    66
    +	EV_KEY, KEY_BLUETOOTH,
    
    67
    +	EV_KEY, KEY_WLAN,
    
    68
    +	EV_KEY, BTN_THUMB,
    
    69
    +	EV_KEY, KEY_VENDOR,
    
    70
    +	EV_KEY, KEY_FULL_SCREEN,
    
    71
    +	EV_KEY, KEY_ZOOMIN,
    
    72
    +	EV_KEY, KEY_ZOOMOUT,
    
    73
    +	EV_KEY, KEY_FN,
    
    74
    +	EV_KEY, KEY_FN_ESC,
    
    75
    +	EV_KEY, KEY_FN_F8,
    
    76
    +	EV_KEY, KEY_FN_F11,
    
    77
    +	EV_KEY, KEY_FN_1,
    
    78
    +	EV_KEY, KEY_FN_2,
    
    79
    +	EV_KEY, KEY_FN_D,
    
    80
    +	EV_KEY, KEY_FN_E,
    
    81
    +	EV_KEY, KEY_FN_F,
    
    82
    +	EV_KEY, KEY_FN_S,
    
    83
    +	EV_KEY, KEY_FN_B,
    
    84
    +
    
    85
    +	EV_MSC, MSC_SCAN,
    
    86
    +	-1, -1,
    
    87
    +};
    
    88
    +
    
    89
    +TEST_DEVICE("sony-vaio-keys",
    
    90
    +	.type = LITEST_SONY_VAIO_KEYS,
    
    91
    +	.features = LITEST_KEYS,
    
    92
    +	.interface = NULL,
    
    93
    +
    
    94
    +	.name = "Sony Vaio Keys",
    
    95
    +	.id = &input_id,
    
    96
    +	.events = events,
    
    97
    +	.absinfo = NULL,
    
    98
    +)

  • test/litest.h
    ... ... @@ -304,6 +304,8 @@ enum litest_device_type {
    304 304
     	LITEST_ELAN_TABLET,
    
    305 305
     	LITEST_ABSINFO_OVERRIDE,
    
    306 306
     	LITEST_TABLET_MODE_UNRELIABLE,
    
    307
    +	LITEST_KEYBOARD_LOGITECH_MEDIA_KEYBOARD_ELITE,
    
    308
    +	LITEST_SONY_VAIO_KEYS,
    
    307 309
     };
    
    308 310
     
    
    309 311
     #define LITEST_DEVICELESS	-2
    

  • test/test-device.c
    ... ... @@ -1462,10 +1462,11 @@ START_TEST(device_capability_nocaps_ignored)
    1462 1462
     	struct libinput *li;
    
    1463 1463
     	struct libinput_device *device;
    
    1464 1464
     
    
    1465
    -	/* SW_MAX isn't handled in libinput so the device is processed but
    
    1466
    -	 * ends up without seat capabilities and is ignored. */
    
    1465
    +	/* SW_PEN_INSERTED isn't handled in libinput so the device is
    
    1466
    +	 * processed but ends up without seat capabilities and is ignored.
    
    1467
    +	 */
    
    1467 1468
     	uinput = litest_create_uinput_device("test device", NULL,
    
    1468
    -					     EV_SW, SW_MAX,
    
    1469
    +					     EV_SW, SW_PEN_INSERTED,
    
    1469 1470
     					     -1);
    
    1470 1471
     	li = litest_create_context();
    
    1471 1472
     	device = libinput_path_add_device(li,
    


  • Reply to: