How to recognize Bluetooth events from "Lenovo Active Pen 2"?

Hi,

I bought the "Lenovo Active Pen 2", that works perfectly on the Touchscreen of my 2-in-1 IdeaPad Flex 5. inxi -Fxxxz is already provided in another posting.

The pen has a Bluetooth interface and a button, that sends key-codes to the laptop when pressed. Unfortunately, I don't know, how to catch them and how to assign them to an action, e.g. opening an application (e.g. Xournal++).

When I press the button, the connection lasts only ca. 1 sec and propably to save energy, it disconnects. In the screenshot you may see, that it works in principle.

BT_Problem

But trying libinput debug-events din't show any keystroke, when I press the button on the pen.

Using btmon, I receive 1000 lines of logging, that I greped for the term "device", only to show connect/disconnect:

Has anybody an idea, how I could catch the keystroke(s) of the pen?

Thanks


root@hog4:/home/noone|⇒  libinput debug-events 
-event3   DEVICE_ADDED     Power Button                      seat0 default group1  cap:k
-event4   DEVICE_ADDED     Video Bus                         seat0 default group2  cap:k
-event0   DEVICE_ADDED     Power Button                      seat0 default group3  cap:k
-event1   DEVICE_ADDED     Lid Switch                        seat0 default group4  cap:S
-event2   DEVICE_ADDED     Sleep Button                      seat0 default group5  cap:k
-event9   DEVICE_ADDED     HD-Audio Generic HDMI/DP,pcm=3    seat0 default group6  cap:
-event16  DEVICE_ADDED     Integrated Camera: Integrated C   seat0 default group7  cap:k
-event12  DEVICE_ADDED     HD-Audio Generic Mic              seat0 default group6  cap:
-event13  DEVICE_ADDED     HD-Audio Generic Headphone        seat0 default group6  cap:
-event8   DEVICE_ADDED     Ideapad extra buttons             seat0 default group8  cap:k
-event14  DEVICE_ADDED     Wacom HID 5218 Pen                seat0 default group9  cap:T  size 309x174mm calib
-event15  DEVICE_ADDED     Wacom HID 5218 Finger             seat0 default group9  cap:t  size 309x174mm ntouches 10 calib
-event6   DEVICE_ADDED     MSFT0001:00 06CB:CE2D Mouse       seat0 default group10 cap:p left scroll-nat scroll-button
-event7   DEVICE_ADDED     MSFT0001:00 06CB:CE2D Touchpad    seat0 default group10 cap:pg  size 102x67mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event5   DEVICE_ADDED     AT Translated Set 2 keyboard      seat0 default group11 cap:k
 event5   KEYBOARD_KEY     +0.000s      *** (-1) pressed
 event5   KEYBOARD_KEY     +0.164s      *** (-1) pressed
^C

grep -i device /btmon_20200702.txt 
@ MGMT Event: Device Connected (0x000b) plen 44                          {0x0002} [hci0] 37.838846
          Human Interface Device (0x1812)
@ MGMT Event: Device Connected (0x000b) plen 44                          {0x0001} [hci0] 37.838846
          Human Interface Device (0x1812)
        UUID: Device Information (0x180a)
        UUID: Human Interface Device (0x1812)
@ MGMT Command: Add Device (0x0033) plen 8                               {0x0001} [hci0] 39.053652
        Action: Auto-connect remote device (0x02)
@ MGMT Event: Device Added (0x001a) plen 8                               {0x0002} [hci0] 39.053665
        Action: Auto-connect remote device (0x02)
      Add Device (0x0033) plen 7
@ MGMT Event: Device Disconnected (0x000c) plen 8                        {0x0002} [hci0] 48.322251
@ MGMT Event: Device Disconnected (0x000c) plen 8                        {0x0001} [hci0] 48.322251

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by