first of all this is not about the touchsupport of the active pen but the top button some pens have!
In the last day or two i tryed setting up the top button of the lenovo active pen 2 and had some trouble…
The conection via bt was no problem (holding down top button 5-7sec) but then the pen will disconect.
The intended behavior(from lenovo active pen2) is as follows: when pressing the top button (short) the device will connect via bt and then send a key press after that it will disconect again.
The initial idea was to use udev rules but these never applyed with the pen maybe the connection time was too short ? information on this is welcome!
The workaround i use now is to use a service which uses
udevadm monitor (shows connection of the pen) and then check if the connected device is the pen…
this works and i can now use the top button!
if someone wants to use my solution u need to add a service with the following:
[Unit] Description=active-pen2 top-button After=graphical-session-pre.target After=auto-rotate.service Wants=graphical-session-pre.target [Service] Environment=DISPLAY=:0 ExecStartPre=/bin/sleep 10 ExecStart=/pathTo/active-pen2 Restart=on-failure SuccessExitStatus=3 4 RestartForceExitStatus=3 4 [Install] WantedBy=default.target
and the activePen2 file should contain
#!/bin/sh DISPLAY=:0 export DISPLAY SERVICE="xournalpp" udevadm monitor | while read -r line do if [[ $line == "KERNEL"*"add"*"hci0:3585"*"bluetooth"* ]]; then if pgrep -x "$SERVICE" >/dev/null then #xournal is running wannt to open the sidebar in xournal(shortcute f12) xte "key F12" else #xournal not running open it now sudo -u felix_j xournalpp &>/dev/null & fi fi done exit 0
if you have a cleaner solution using udev pls comment !
my udev rule to test if my pen would raise a add action was
ACTION=“add”, RUN+=“sudo -u felix_j xournalpp &>/dev/null &”
this would work if connecting a usb device or headphones but not with the active pen2 top button