PeterCxy / scroll-emulation

Middle button scrolling emulation for Wayland (tested on GNOME Wayland)
28 stars 3 forks source link

Warning #5

Open com2 opened 1 year ago

com2 commented 1 year ago

Thank you for the effort to make this work. Still want to use my antique marblemouse without scrollwheel until it finally gives the ghost.

Did never compile anything at this level. Response after running your compile command in Debian 12 after installing packages build-essential and libinput-dev:

hook.c: In function ‘libinput_device_get_name’:
hook.c:8:3: warning: implicit declaration of function ‘set_scroll_emulation’ [-Wimplicit-function-declaration]
    8 |   set_scroll_emulation(device); // Inject the code to set scrolling emulation
      |   ^~~~~~~~~~~~~~~~~~~~
hook.c: At top level:
hook.c:14:6: warning: conflicting types for ‘set_scroll_emulation’; have ‘void(struct libinput_device *)’
   14 | void set_scroll_emulation(struct libinput_device *device) {
      |      ^~~~~~~~~~~~~~~~~~~~
hook.c:8:3: note: previous implicit declaration of ‘set_scroll_emulation’ with type ‘void(struct libinput_device *)’
    8 |   set_scroll_emulation(device); // Inject the code to set scrolling emulation
      |   ^~~~~~~~~~~~~~~~~~~~

Are these warnings normal or should I be worried?

com2 commented 1 year ago

I placed hook.so in /usr/local/lib and added according to instructions in the file /etc/profile.d/libinput.sh: export LD_PRELOAD="$LD_PRELOAD /usr/local/lib/hook.so" I rebooted but the right mouse button does cause it to function as scroll-wheel. What am I missing?

waldhef commented 2 months ago

Hello, export LD_PRELOAD="$LD_PRELOAD /usr/local/lib/hook.so" didn't work for me too.

I've found the solution in a closed issue: https://github.com/PeterCxy/scroll-emulation/issues/2

You have to put the path to you hook.so file in the /etc/ld.so.preload file. Eg:

sudo nano /etc/ld.so.preload and put /usr/local/lib/hook.so there.

If you don't have /etc/ld.so.preload file, then you have to create one. I had to create one in my Debian Bookworm install. And yes I had also those warning on compile process.

Hope this helps, good luck.