CFT: EVDEV support in psm(4) driver
Anthony Jenkins
Scoobi_doo at yahoo.com
Wed Jun 7 23:35:55 UTC 2017
I'm seeing flakiness in X11 (KDE) with evdev enabled - a couple keys are
reporting multiple (wrong) events and some aren't emitting any events
(or they are, but they're NoSymbol):
- Down arrow: emits KeyPress for keycode 116 (Super_R), KeyRelease for
keycode 116, KeyRelease for keycode 104 (Down)
- Left arrow: emits KeyPress for keycode 113 (Alt_R), KeyPress for
keycode 100 (Left), KeyRelease for keycode 113, KeyRelease for keycode 100
- Volume up: emits KeyPress 123 (NoSymbol), KeyPress 176 (NoSymbol),
KeyRelease for same
- Volume down: emits KeyPress 122 (NoSymbol), KeyPress 174 (NoSymbol),
KeyRelease for same
- Volume mute toggle: emits KeyPress 121 (NoSymbol), KeyRelease 121
(NoSymbol), KeyRelease 140 (NoSymbol)
- Keypad end: emits KeyPress 115 (Super_L), KeyPress 103 (End),
KeyRelease for same
I'll attach the output of 'evdev -event keyboard' for everything but the
Keypad end key which I recently found.
/usr/local/etc/X11/xorg.conf.d/evdev1.conf:
Section "InputDevice"
Identifier "Keyboard0"
Driver "evdev"
Option "Device" "/dev/input/event1"
EndSection
dmesg | grep kbd:
[ajenkins at ajenkins-hplaptop ~]$ dmesg | grep kbd
kbd: new array size 4
kbd1 at kbdmux0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
atkbd: the current kbd controller command byte 0067
atkbd: keyboard ID 0x41ab (2)
kbdc: RESET_KBD return code:00fa
kbdc: RESET_KBD status:00aa
kbd0 at atkbd0
kbd0: atkbd0, AT 101/102 (2), config:0x0, flags:0x1d0000
atkbd0: [GIANT-LOCKED]
random: harvesting attach, 8 bytes (4 bits) from atkbd0
random: harvesting attach, 8 bytes (4 bits) from atkbdc0
kbdc: TEST_AUX_PORT status:0000
kbdc: RESET_AUX return code:00fa
kbdc: RESET_AUX status:00aa
kbdc: RESET_AUX ID:0000
kbdc: RESET_AUX return code:00fa
kbdc: RESET_AUX status:00aa
kbdc: RESET_AUX ID:0000
psm0: <PS/2 Mouse> irq 12 on atkbdc0
atkbdc: atkbdc0 already exists; skipping it
/var/log/Xorg.0.log stuff:
[ 24.763] (**) Option "config_info" "udev:/dev/input/event1"
[ 24.763] (II) XINPUT: Adding extended input device "System keyboard
multiplexer" (type: KEYBOARD, id 7)
[ 24.763] (**) Option "xkb_rules" "evdev"
[ 24.839] (II) config/udev: Adding input device AT keyboard
(/dev/input/event2)
[ 24.839] (**) AT keyboard: Applying InputClass "evdev keyboard catchall"
[ 24.839] (II) Using input driver 'evdev' for 'AT keyboard'
[ 24.839] Option "_source" "server/udev"
[ 24.839] Option "name" "AT keyboard"
[ 24.839] Option "path" "/dev/input/event2"
[ 24.839] Option "device" "/dev/input/event2"
[ 24.839] Option "major" "0"
[ 24.839] Option "minor" "45"
[ 24.839] Option "driver" "evdev"
[ 24.839] Option "config_info" "udev:/dev/input/event2"
[ 24.839] (**) AT keyboard: always reports core events
[ 24.839] (**) evdev: AT keyboard: Device: "/dev/input/event2"
[ 24.839] (--) evdev: AT keyboard: Vendor 0x1 Product 0x1
[ 24.839] (--) evdev: AT keyboard: Found keys
[ 24.839] (II) evdev: AT keyboard: Configuring as keyboard
[ 24.839] (**) Option "config_info" "udev:/dev/input/event2"
[ 24.840] (II) XINPUT: Adding extended input device "AT keyboard"
(type: KEYBOARD, id 8)
[ 24.840] (**) Option "xkb_rules" "evdev"
[ 24.840] (II) XKB: Reusing cached keymap
[ 24.840] (II) config/udev: Adding input device Synaptics Touchpad
(/dev/input/event3)
[ 24.841] (**) Synaptics Touchpad: Applying InputClass "evdev pointer
catchall"
[ 24.841] (**) Synaptics Touchpad: Applying InputClass "evdev
touchpad catchall"
[ 24.841] (**) Synaptics Touchpad: Applying InputClass "touchpad
catchall"
[ 24.841] (**) Synaptics Touchpad: Applying InputClass "Default
clickpad buttons"
[ 24.841] (II) LoadModule: "synaptics"
[ 24.841] (II) Loading /usr/local/lib/xorg/modules/input/synaptics_drv.so
[ 24.842] (II) Module synaptics: vendor="X.Org Foundation"
[ 24.842] compiled for 1.19.3, module version = 1.9.0
[ 24.842] Module class: X.Org XInput Driver
[ 24.843] ABI class: X.Org XInput driver, version 24.1
[ 24.843] (II) Using input driver 'synaptics' for 'Synaptics Touchpad'
[ 24.843] Option "_source" "server/udev"
[ 24.843] Option "name" "Synaptics Touchpad"
[ 24.843] Option "path" "/dev/input/event3"
[ 24.843] Option "device" "/dev/input/event3"
[ 24.843] Option "major" "0"
[ 24.843] Option "minor" "50"
[ 24.843] Option "driver" "synaptics"
Not sure what else to add. I have applied the patches from this email
thread. Any ideas?
Thanks in advance,
Anthony Jenkins
On 04/17/17 06:59, Jan Kokemüller wrote:
> Hi Vladimir,
> this patch works great for me!
> I'm testing this with a semi-mt Synaptics touchpad and a TrackPoint of
> a Lenovo T420. I'm running 12-CURRENT (amd64) and Xorg 1.19.3 from
> Matthew's CFT with the libudev-devd backend. The Evdev devices are
> picked up correctly by libudev-devd and xf86-input-libinput (even the
> TrackPoint). I haven't tested this with xf86-input-synaptics (which is
> in maintenance mode) or xf86-input-evdev. I am not
> using xf86-input-mouse or xf86-input-keyboard.
>
> What works (everything):
> - true smooth scrolling with Xinput2 (tested with GTK3 Firefox or
> gtk3-demo)
> - TrackPoint scrolling holding the middle button
> - both horizontal/vertical scrolling
> - two finger scrolling powered by libinput (this semi-mt touchpad
> doesn't really support more gestures than this)
>
> The only thing that doesn't work out of the box is the mouse pointer
> on the VT console. It wouldn't be hard though to write a small tool
> that uses libinput to translate Evdev events into CONS_MOUSECTL ioctls
> needed for the VT pointer.
>
> Some comments:
> - PS2_MOUSE_SYNAPTICS_PRODUCT should be 0x0007, not 0x0009
> (http://lxr.free-electrons.com/source/drivers/input/mouse/psmouse.h#L86)
> - The TrackPoint should be added with product id 0x000A as on Linux
> and with the INPUT_PROP_POINTING_STICK Evdev property set
> - I think it would be better if the same Evdev device names were
> exposed as on Linux (for example "SynPS/2 Synaptics TouchPad"). Many
> scripts using xinput to change device properties depend on the Linux
> device names.
>
> I've added a patch and comments to https://reviews.freebsd.org/D10265 .
>
> Even Linux 64-bit binaries work correctly with the created
> /dev/input/event* devices after applying those two patches here:
> - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218625
> - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218627
>
> This will be very useful for Linux games using joysticks, game
> controllers etc.
Hi Vladimir and Jan,
Thanks for the patches! I'm having some issues with 3 patches from this
thread:
-
https://reviews.freebsd.org/file/data/pqjvpuhwfgsu5nnamibg/PHID-FILE-uuyjx66blb344hre3nc2/D10207.vson.id27478.whitespaceignore-most.diff
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218625
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218627
These may or may not have anything to do with the patches...
1. For some reason Xorg keyboard driver isn't getting some key events,
or had shuffled them. When I first applied the patches, X thought my
<Down> arrow was <KP_Enter> and <KP_Enter> was something else. At some
point that behavior changed and <Down> worked, but <KP_Divide> emits
<KP_Multiply> and <KP_Multiply> doesn't emit anything. Rebooting didn't
change the new behavior, and I don't know what caused it to change.
Switching to a console, I get the expected characters/actions when
pressing these keys.
2. My Synaptics clickpad (and the pointer in general) freeze for several
seconds, although it hasn't done it lately. When a freeze occurs (in X
windows), other GUI processes don't seem to be affected. If I have
another pointer device attached (e.g. USB mouse), it also doesn't move
the pointer during the freeze.
Here's my config:
-------------- next part --------------
#######################################
###### START xev -event keyboard ######
#######################################
Outer window is 0x5600001, inner window is 0x5600002
KeymapNotify event, serial 21, synthetic NO, window 0x0,
keys: 4294967205 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#############################
###### PRESS UP ARROW ######
#############################
KeyPress event, serial 25, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1052178, (-371,465), root:(527,488),
state 0x10, keycode 111 (keysym 0xff61, Print), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 25, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1052179, (-371,465), root:(527,488),
state 0x10, keycode 98 (keysym 0xff52, Up), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 28, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 28, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1052294, (-371,465), root:(527,488),
state 0x10, keycode 111 (keysym 0xff61, Print), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 28, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 28, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1052294, (-371,465), root:(527,488),
state 0x10, keycode 98 (keysym 0xff52, Up), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
################################
###### PRESS RIGHT ARROW ######
################################
MappingNotify event, serial 30, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 30, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1059439, (-371,465), root:(527,488),
state 0x10, keycode 114 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 30, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 30, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1059439, (-371,465), root:(527,488),
state 0x10, keycode 102 (keysym 0xff53, Right), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 32, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 32, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1059537, (-371,465), root:(527,488),
state 0x10, keycode 114 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 32, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 32, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1059537, (-371,465), root:(527,488),
state 0x10, keycode 102 (keysym 0xff53, Right), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
########################################
###### PRESS DOWN ARROW (BROKEN) ######
########################################
MappingNotify event, serial 34, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 34, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1082146, (-371,465), root:(527,488),
state 0x10, keycode 116 (keysym 0xffec, Super_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 34, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeymapNotify event, serial 36, synthetic NO, window 0x0,
keys: 1 0 0 0 0 0 0 0 0 0 0 0 0 1 16 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
MappingNotify event, serial 36, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 36, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1082304, (-371,465), root:(527,488),
state 0x50, keycode 116 (keysym 0xffec, Super_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 36, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 36, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1082304, (-371,465), root:(527,488),
state 0x10, keycode 104 (keysym 0xff54, Down), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
########################################
###### PRESS LEFT ARROW (BROKEN) ######
########################################
MappingNotify event, serial 38, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 38, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1089673, (-371,465), root:(527,488),
state 0x10, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 38, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 38, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1089673, (-371,465), root:(527,488),
state 0x18, keycode 100 (keysym 0xff51, Left), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 40, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 40, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1089798, (-371,465), root:(527,488),
state 0x18, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 40, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 40, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1089798, (-371,465), root:(527,488),
state 0x10, keycode 100 (keysym 0xff51, Left), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
#######################################
###### PRESS VOLUME UP (BROKEN) ######
#######################################
MappingNotify event, serial 42, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 42, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1098562, (-371,465), root:(527,488),
state 0x10, keycode 123 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 42, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 42, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1098562, (-371,465), root:(527,488),
state 0x10, keycode 176 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 42, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 42, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1098564, (-371,465), root:(527,488),
state 0x10, keycode 123 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 42, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 42, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1098565, (-371,465), root:(527,488),
state 0x10, keycode 176 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
#########################################
###### PRESS VOLUME DOWN (BROKEN) ######
#########################################
MappingNotify event, serial 46, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 46, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1103468, (-371,465), root:(527,488),
state 0x10, keycode 122 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 46, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 46, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1103469, (-371,465), root:(527,488),
state 0x10, keycode 174 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 46, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1103471, (-371,465), root:(527,488),
state 0x10, keycode 174 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 46, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 46, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1103471, (-371,465), root:(527,488),
state 0x10, keycode 122 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
#########################################
###### PRESS VOLUME MUTE (BROKEN) ######
#########################################
MappingNotify event, serial 49, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 49, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1110872, (-371,465), root:(527,488),
state 0x10, keycode 140 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 49, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 49, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1110872, (-371,465), root:(527,488),
state 0x10, keycode 121 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 51, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1110876, (-371,465), root:(527,488),
state 0x10, keycode 121 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 51, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 51, synthetic NO, window 0x5600001,
root 0x499, subw 0x0, time 1110876, (-371,465), root:(527,488),
state 0x10, keycode 140 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
ClientMessage event, serial 52, synthetic YES, window 0x5600001,
message_type 0x148 (WM_PROTOCOLS), format 32, message 0x149 (WM_DELETE_WINDOW)
###################################
##### END xev -event keyboard #####
###################################
More information about the freebsd-mobile
mailing list