Acabei de adquirir um Logitech Spotlight Presenter, ele possui dois botões que possuem códigos de teclas incompatíveis com minha apresentação (revealjs).
Next
e Previous
são vinculados como Right
e Left
, enquanto eu quero alterá-los para n
e p
. Estou usando o Ubuntu 18.04 e o ArchLinux.
O parâmetro do dispositivo:
$ lsusb -d 046d:c53e -v
Bus 001 Device 012: ID 046d:c53e Logitech, Inc.
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 32
idVendor 0x046d Logitech, Inc.
idProduct 0xc53e
bcdDevice 41.00
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 84
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 4
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 59
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 8
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 2
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 98
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 2
Aqui estão as chaves de exibição atuais:
# showkeys --scancodes
0xe0 0x4d 0xe0 0xcd
0xe0 0x4b 0xe0 0xcb
# showkeys --keycodes
keycode 106 release
keycode 105 release
Aqui estão as teclas de exibição de acordo com o meu teclado:
# showkeys --scancodes
0x31 0xb1
p0x19 0x99
# showkeys --keycodes
keycode 49 release
keycode 25 release
Eu deduzi o seguinte /lib/udev/hwdb.d/61-logitech-spotlight-presenter-revealjs.hwdb
:
# This file has been created to improve Logitech Spotlight Presenter in revealjs
evdev:input:b*v046dpc53e*
KEYBOARD_KEY_69=p
KEYBOARD_KEY_6a=n
então tentei o seguinte
$ sudo systemd-hwdb update
$ udevadm trigger
$ sudo udevadm control --reload-rules && udevadm trigger
Mas meu controle remoto ainda dispara Right
/ Left
.
O software de código aberto Projecteur permite mapear os botões do Logitech Spotlight (e ter um ponto de desktop personalizável)
Página inicial do projeto: https://github.com/jahnf/Projecteur
Pacotes para arch também estão disponíveis: https://aur.archlinux.org/packages/projecteur
Para o Ubuntu, os pacotes estão disponíveis na página do github do projeto, bem como nos repositórios do Ubuntu 20.10 e posteriores.
Disclaimer: Eu sou o autor de Projecteur