jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
379 stars 33 forks source link

AVATTO i9 issue #101

Closed alinelena closed 4 years ago

alinelena commented 4 years ago

got a new pointer from aliexpress... is sold as avatto i9....

https://www.aliexpress.com/item/32826298891.html?spm=a2g0s.9042311.0.0.52e04c4dKdnh5Z

itself works as described in linux... which is interesting.

now I would like to see if is possible to convert it projecteur

adding it as usb in .config file, makes it to connect to projecter... which is nice but now will be useful to be able to toggle on off the pointer

[2020-08-17T19:16:32.894][inf][projecteur.device] Connected device: AVATTO i9 (1915:1001)

jahnf commented 4 years ago

Could you elaborate, what you exactly mean?

adding it as usb in .config file, makes it to connect to projecter... which is nice but now will be useful to be able to toggle on off the pointer

As described in the README, Projecteur acts on "mouse"-movement to toggle the spotlight. But also there is a new action in the current develop version that you can bind to toggle the spotlight overlay as a whole. (Toggle Spotlight Action, see screenshot)

Screenshot from 2020-08-17 20-32-36

alinelena commented 4 years ago

Do you mean the device always acts as an air mouse? (not only when you press the "Mouse" button) yes but this happens even without projecteur so I suspect is something deeper, i am opensuse tumbleweed kde and x11.

I will need to see how i can add actions somehow does not seem to read the presses.

jahnf commented 4 years ago

Well, looking at the device with the link you posted, it seems the air mouse with that device is always on, no way to toggle it or turn it off (besides from turning the whole device off)

But button mapping should still be possible if everything else is set up correctly. What's the output of projecteur -f and projecteur -d?

alinelena commented 4 years ago

indeed this is the situation with respect to the mouse function is always on. what I was wondering if cursor could be set off(blank) by default and on when the last button on the device is pressed. I suspect if this is possible any mouse can be transformed in a presenter.

outputs below, the only change i did is in .config to add the device.

   drFaustroll  circassia  ~  projecteur -f 
Projecteur 0.9-alpha.28
  - git-branch: develop
  - git-hash: 012d2b22027c22b5105c1cf29fc8efaa48fd2759
  - dirty-flag: 1
  - compiler: GNU 10.2.1
  - qt-version: (build: 5.15.0, runtime: 5.15.0)
  - device-scan: (errors: 0, devices: 1 [readable: 1, writable: 1])
   drFaustroll  circassia  ~  projecteur -d
Projecteur 0.9-alpha.28; device scan

 * Found 1 supported devices. (1 readable, 1 writable)

 +++ name:     '123 COM Smart Control'
     userName: 'AVATTO i9'
     vendorId:  1915
     productId: 1001
     phys:      usb-0000:39:00.0-2.1.3
     busType:   USB
     devices:   /dev/input/event258, /dev/input/event259, /dev/input/event256, /dev/input/event257
     readable:  true
     writable:  true
jahnf commented 4 years ago

I suspect if this is possible any mouse can be transformed in a presenter.

That is already the case and works - any mouse can be used (if added via the command line with -D and the input device is readable for the user running projecteur). I used to have a second mouse on my desk just for these purposes :smiley:

Does button mapping with other devices (i10pro, Logitech Spotlight...) work for you? (edit: or with any other device (e.g. a mouse) for that matter)

alinelena commented 4 years ago

yes tested on the Avatto i10 pro works there. I wonder if something else steals the keys.

this is what I see in xev when trying it this is click, the long press gives alt+tab behaviour, the mouse button is an enter behaviour

KeyPress event, serial 41, synthetic NO, window 0x6a00001,
    root 0x1d6, subw 0x0, time 50679140, (-1454,1436), root:(1423,1489),
    state 0x0, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XmbLookupString gives 1 bytes: (09) "       "
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x6a00001,
    root 0x1d6, subw 0x0, time 50679172, (-1454,1436), root:(1423,1489),
    state 0x0, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XFilterEvent returns: False
jahnf commented 4 years ago
  1. Could you please start Projecteur with debug logging level (-l dbg) and then try to record button presses and post the full log here?
  2. Does your log show that a uinput device was successfully created?

Screenshot from 2020-08-18 18-33-47

1) Should result in a log similar to this:

[2020-08-18T18:30:37.363][inf][projecteur.virtualdevice] Created uinput device: /sys/devices/virtual/input/input42
[2020-08-18T18:30:37.365][dbg][projecteur.device] Connected sub-device: Logitech Spotlight (USB) (046d:c53e) /dev/input/event16
[2020-08-18T18:30:37.365][dbg][projecteur.device] Connected sub-device: Logitech Spotlight (USB) (046d:c53e) /dev/input/event19
[2020-08-18T18:30:37.366][dbg][projecteur.device] Connected sub-device: Logitech Spotlight (USB) (046d:c53e) /dev/input/event17
[2020-08-18T18:30:37.366][dbg][projecteur.device] Connected sub-device: Logitech Spotlight (USB) (046d:c53e) /dev/input/event18
[2020-08-18T18:30:37.560][dbg][projecteur.mainapp] Qt platform plugin: xcb; Desktop Environment: Gnome; Wayland: false
[2020-08-18T18:30:37.833][inf][projecteur.device] Connected device: Logitech Spotlight (USB) (046d:c53e)
[2020-08-18T18:31:00.542][dbg][projecteur.input] Recorded device event: [{1, 272, 1},]
[2020-08-18T18:31:00.598][dbg][projecteur.input] Recorded device event: [{1, 272, 0},]
[2020-08-18T18:31:00.782][dbg][projecteur.input] Recorded device event: [{1, 272, 1},]
[2020-08-18T18:31:00.838][dbg][projecteur.input] Recorded device event: [{1, 272, 0},]
[2020-08-18T18:31:18.452][dbg][projecteur.input] Recorded device event: [{4, 4, 458831},{1, 106, 1},]
...
alinelena commented 4 years ago

found the issue... the mouse was moving and interfering with the recording. output below.

still I need to see how i activate the spot on click, rather than on move as it is now.

[2020-08-18T20:22:00.388][dbg][projecteur.settings] Loading values from config: /home/drFaustroll/.config/Projecteur/Projecteur.conf 
[2020-08-18T20:22:00.388][dbg][projecteur.settings] spot.size = 5
[2020-08-18T20:22:00.388][dbg][projecteur.settings] dot = true
[2020-08-18T20:22:00.388][dbg][projecteur.settings] dot.size = 30
[2020-08-18T20:22:00.388][dbg][projecteur.settings] dot.color = #00ff00
[2020-08-18T20:22:00.388][dbg][projecteur.settings] shade.color = #222222
[2020-08-18T20:22:00.388][dbg][projecteur.settings] spot.shape =  spotshapes/Circle.qml
[2020-08-18T20:22:00.388][dbg][projecteur.settings] border =  true
[2020-08-18T20:22:00.388][dbg][projecteur.settings] border.color =  #73d216
[2020-08-18T20:22:00.388][dbg][projecteur.settings] border.size =  18
[2020-08-18T20:22:00.388][dbg][projecteur.settings] spot.shape.star.points =  6
[2020-08-18T20:22:00.388][dbg][projecteur.settings] spot.shape.star.innerRadius =  40
[2020-08-18T20:22:00.389][inf][projecteur.virtualdevice] Created uinput device: /sys/devices/virtual/input/input51
[2020-08-18T20:22:00.391][dbg][projecteur.device] Connected sub-device: AVATTO i9 (1915:1001) /dev/input/event26
[2020-08-18T20:22:00.391][dbg][projecteur.device] Connected sub-device: AVATTO i9 (1915:1001) /dev/input/event27
[2020-08-18T20:22:00.391][dbg][projecteur.device] Connected sub-device: AVATTO i9 (1915:1001) /dev/input/event29
[2020-08-18T20:22:00.391][dbg][projecteur.device] Connected sub-device: AVATTO i9 (1915:1001) /dev/input/event28
[2020-08-18T20:22:00.588][dbg][projecteur.mainapp] Qt platform plugin: xcb; Desktop Environment: Unknown; Wayland: false
[2020-08-18T20:22:01.849][inf][projecteur.device] Connected device: AVATTO i9 (1915:1001)
[2020-08-18T20:22:01.851][dbg][projecteur.mainapp] Spotlight window visible =  true
[2020-08-18T20:22:22.610][dbg][projecteur.input] Recorded device event: [{4, 4, 458795},{1, 15, 1},]
[2020-08-18T20:22:22.634][dbg][projecteur.input] Recorded device event: [{4, 4, 458795},{1, 15, 0},]
[2020-08-18T20:22:28.746][dbg][projecteur.input] Input map action, type =  3 , partial_hit =  false
[2020-08-18T20:22:30.562][dbg][projecteur.input] Input map action, type =  3 , partial_hit =  false
jahnf commented 4 years ago

I guess when the spotlight overlay appears, it takes away the focus of the preferences window when recording button presses - and therefore stopping the recording.

You probably should try recording only when the spotlight overlay is disabled, like so 90431188-f2cfb100-e0c8-11ea-89bb-3f2733156702 Hopefully that works.

In general, from what I see, the Avatto i9 it will not be able to behave like a Logitech Spotlight or Avatto H100 (only move the cursor and therefore showing the spotlight while pressing down a button)

But you can map some button combination on the device to the "Toggle Spotlight" Action which will then toggle that overlay. So it is similar. Only difference with this device is that the mouse is always moving and you will have to press some buttons to activate the spotlight overlay and press again some buttons to disable the spotlight overlay.

jahnf commented 4 years ago

@alinelena Did you manage to get your Avatto i9 working with a "Toggle Spotlight" button mapping?

jahnf commented 4 years ago

Closing due to inactivity.