DeedleFake / ptt-fix

X11 key forwarder to allow push-to-talk to work in Wayland.
MIT License
11 stars 0 forks source link

Debian 12 Installation failed #7

Closed GeorgeV220 closed 1 year ago

GeorgeV220 commented 1 year ago

Hey, I have installed the libxdo-dev in my debian system but I'm still getting the error message

go build deedles.dev/ptt-fix/internal/xdo:
# pkg-config --cflags  -- libxdo
Package libxdo was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxdo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxdo', required by 'virtual:world', not found
pkg-config: exit status 1
GeorgeV220 commented 1 year ago

I fixed the issue by manually installing xdotool, but I have another issue, 0x109 does not work

Jul 30 01:27:02.974 INFO loaded config
    path=/root/.config/ptt-fix/config
Jul 30 01:27:02.984 INFO initialized device
    device=/dev/input/by-id/usb-0600_USBFC1-MAX-event-if03
    name=USBFC1-MAX
    bus=3
    vendor=1536
    product=42262
Jul 30 01:27:02.984 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-if01
    name="E-Signal USB Gaming Mouse"
    bus=3
    vendor=1241
    product=41119
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-if01
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 WARN ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-mouse
    reason="failed to open"
    err="get device name: inappropriate ioctl for device"
Jul 30 01:27:02.985 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-kbd
    name="BY Tech Usb Gaming Keyboard"
    bus=3
    vendor=9610
    product=22
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-kbd
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-if01
    name="BY Tech Usb Gaming Keyboard"
    bus=3
    vendor=9610
    product=22
Jul 30 01:27:02.985 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-event-mouse
    name="BY Tech Usb Gaming Keyboard Mouse"
    bus=3
    vendor=9610
    product=22
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-if01
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-if01-event-kbd
    name="E-Signal USB Gaming Mouse Keyboard"
    bus=3
    vendor=1241
    product=41119
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-if01-event-kbd
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-mouse
    name="E-Signal USB Gaming Mouse"
    bus=3
    vendor=1241
    product=41119
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-mouse
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 WARN ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-mouse
    reason="failed to open"
    err="get device name: inappropriate ioctl for device"
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-event-mouse
    reason="incapable of sending requested key code"
Jul 30 01:27:02.985 INFO ignoring device
    device=/dev/input/by-id/usb-0600_USBFC1-MAX-event-if03
    reason="incapable of sending requested key code"
Jul 30 01:27:03.085 ERROR fatal
    err="no devices available"
exit status 1
DeedleFake commented 1 year ago

Can I see the key and sym lines of your config, please?

GeorgeV220 commented 1 year ago
# This is an example default config that is automatically generated.
# Feel free to edit it to fit your particular system.

# The `key` directive indicates a key to listen for from a device. The
# key is denoted by an integer code. The codes for specific keys can
# be found in /usr/include/linux/input-event-codes.h by looking for a
# macro definition that's named like the key you want to use and then
# finding the corresponding number at the end of the line. For
# example, the default, left alt, is 56, and can be found as
# `KEY_LEFTALT` in the aforementioned file.
#
# The value may also be specified in hex, octal, or binary by
# prefixing it with `0x`, `0` or `0o`, or `0b`, respectively.
key 0x109

# The `sym` directive indicates the symbol to send to the application
# that is listening for push-to-talk events. This symbol is a string
# which corresponds to the macro names in
# /usr/include/xkbcommon/xkbcommon-keysyms.h. For example, the symbol
# for the default, left alt, is `Alt_L` and the macro listed in the
# aforementioned header file is `XKB_KEY_Alt_L`. Simply find the key
# that you'd like and remove the `XKB_KEY_` prefix.
#
# As a special case, the symbol may instead be in the form
# `mouse <number>` where `<number>` is any integer. This will cause a
# mouse button press to be sent instead. For example, `mouse 2` will
# cause mouse 2, the scroll wheel click, to be sent to the
# application.
sym mouse 5

# The `retry` directive indicates the amount of time to wait before
# retrying a device when it has a potentially temporary error, such as
# having been disconnected from the computer. A value of `0` indicates
# that no retry attempts should be made.
retry 10s

# A `device` directive indicates a glob to use to find device files to
# listen to. This directive may be specified more than once. All
# listed devices will be listened to if they are capable of sending
# the requested key.
device /dev/input/by-id/*
#device /dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-if01-event-kbd
DeedleFake commented 1 year ago

That just might simply not be the button code that you're looking for. A few possibilities that I can think of:

GeorgeV220 commented 1 year ago

That just might simply not be the button code that you're looking for. A few possibilities that I can think of:

* Have you configured your mouse to send other keys when buttons are pressed? I've got a button on my mouse that sends a `,` when pressed, for example.

* Did you mean numpad 9? If so, that's `10`, not `0x109`.

* It's possible that what you're looking for is a different, not so obvious number. For example, mouse button one is actually `BTN_LEFT`, not `BTN_1`. Try some of the other ones elsewhere in the file that start with `BTN_` and see if any of them are what you want.

Thank you for your reply, I want to use the forward button on my mouse but in discord (xorg) it registers as button 9 so that's why I used 0x109. I'll check it out!!

DeedleFake commented 1 year ago

There's a BTN_FORWARD that's listed as 0x115.

GeorgeV220 commented 1 year ago

There's a BTN_FORWARD that's listed as 0x115.

0x115 does not work, I get

Jul 31 22:10:54.919 INFO loaded config
    path=/root/.config/ptt-fix/config
Jul 31 22:10:54.929 WARN ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-mouse
    reason="failed to open"
    err="get device name: inappropriate ioctl for device"
Jul 31 22:10:54.929 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-if01-event-kbd
    name="E-Signal USB Gaming Mouse Keyboard"
    bus=3
    vendor=1241
    product=41119
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-if01-event-kbd
    reason="incapable of sending requested key code"
Jul 31 22:10:54.929 INFO initialized device
    device=/dev/input/by-id/usb-0600_USBFC1-MAX-event-if03
    name=USBFC1-MAX
    bus=3
    vendor=1536
    product=42262
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-0600_USBFC1-MAX-event-if03
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-if01
    name="E-Signal USB Gaming Mouse"
    bus=3
    vendor=1241
    product=41119
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-if01
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 INFO initialized device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-mouse
    name="E-Signal USB Gaming Mouse"
    bus=3
    vendor=1241
    product=41119
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-event-mouse
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-kbd
    name="BY Tech Usb Gaming Keyboard"
    bus=3
    vendor=9610
    product=22
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-kbd
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-if01
    name="BY Tech Usb Gaming Keyboard Consumer Control"
    bus=3
    vendor=9610
    product=22
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-event-if01
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 INFO initialized device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-event-mouse
    name="BY Tech Usb Gaming Keyboard Mouse"
    bus=3
    vendor=9610
    product=22
Jul 31 22:10:54.930 INFO ignoring device
    device=/dev/input/by-id/usb-BY_Tech_Usb_Gaming_Keyboard-if01-event-mouse
    reason="incapable of sending requested key code"
Jul 31 22:10:54.930 WARN ignoring device
    device=/dev/input/by-id/usb-E-Signal_USB_Gaming_Mouse-mouse
    reason="failed to open"
    err="get device name: inappropriate ioctl for device"
Jul 31 22:10:55.007 ERROR fatal
    err="no devices available"
exit status 1
GeorgeV220 commented 1 year ago

OK I found the correct one for my mouse, it is 0x114 (BTN_EXTRA) not 0x115 (BTN_FORWARD) for some reason.