Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logitech mouse buttons 6 and 7 #12

Closed
jim8989 opened this issue Dec 31, 2020 · 28 comments
Closed

Logitech mouse buttons 6 and 7 #12

jim8989 opened this issue Dec 31, 2020 · 28 comments

Comments

@jim8989
Copy link

jim8989 commented Dec 31, 2020

Good day sir,
I'm trying to set up a couple mouse buttons using a Logitech M705 mouse. In the Device drop down window I can choose Logitech M705. Left clicking under the Key column with button #2 I get BTN_MIDDLE and I can enter super_l in the mapping column. After saving and applying, I can press the middle button and the super_l is simulated which opens and closes the Activities Overview window perfectly. After pressing the Apply Defaults button and I press button 6 or 7 in the Key column nothing happens. If I execute the command 'xev' button 6 and 7 are recognized.

Looking forward to the feature of combining keys that you stated is getting close. I will be adding two modifiers and a key for button 6 and 7. Everything else is working fine. In fact using your program to simulate button 2 works exactly as if I was using the Super key. Xdotool and xte do not give me the same results pressing button #2

I'm running your software on a laptop that has POP_OS 20.04 installed. There will be some differences between button 2 and buttons 6 and 7. Using 'xev' when I press button 2 down I get one response and I get a second response when I release button 2. If I hold down button 6 or 7 down the buttons do a repeat until I release them.

Jim

@sezanzeb
Copy link
Owner

sezanzeb commented Dec 31, 2020

Hi, thanks for posting an issue!

First, please install the latest source. Afterwards, can you run sudo key-mapper-gtk -d and try to set your buttons 6 and 7 to something? Post the output here.

@jim8989
Copy link
Author

jim8989 commented Dec 31, 2020

Key Mapper_007
I installed - key-mapper-0.4.0.deb
I pressed button 6 and 7 a couple times.

Loaded config from "/home/jb/.config/key-mapper/config.json"
Writing "/home/jb/.config/key-mapper/xmodmap.json"
INFO: logger.py, line 116, Could not figure out the version
DEBUG: logger.py, line 117, The 'key-mapper' distribution was not found and is required by the application
WARNING: logger.py, line 120, Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
DEBUG: logger.py, line 126, pid 9765
DEBUG: data.py, line 86, Found data at "/usr/share/key-mapper"
DEBUG: getdevices.py, line 93, Discovering device paths
SPAM: getdevices.py, line 116, Found "Logitech M705", /dev/input/event11, usb-0000:00:1d.2-1
SPAM: getdevices.py, line 116, Found "HP WMI hotkeys", /dev/input/event7, wmi
SPAM: getdevices.py, line 116, Found "ST LIS3LV02DL Accelerometer", /dev/input/event6, lis3lv02d
SPAM: getdevices.py, line 116, Found "SynPS/2 Synaptics TouchPad", /dev/input/event5, isa0060
SPAM: getdevices.py, line 116, Found "Video Bus", /dev/input/event4, LNXVIDEO
SPAM: getdevices.py, line 116, Found "AT Translated Set 2 keyboard", /dev/input/event3, isa0060
SPAM: getdevices.py, line 116, Found "Sleep Button", /dev/input/event0, PNP0C0E
INFO: getdevices.py, line 179, Found "Logitech M705", "HP WMI hotkeys", "ST LIS3LV02DL Accelerometer", "SynPS/2 Synaptics TouchPad", "Video Bus", "Sleep Button"
DEBUG: presets.py, line 144, The newest preset is "Logitech M705", "Activities"
DEBUG: window.py, line 422, Selecting device "Logitech M705"
DEBUG: window.py, line 241, "Logitech M705" presets: "Activities", "new preset"
DEBUG: window.py, line 469, Selecting preset "Activities"
INFO: mapping.py, line 139, Loading preset from "/home/jb/.config/key-mapper/presets/Logitech M705/Activities.json"
SPAM: mapping.py, line 175, (1, 274, 1) maps to super_l
DEBUG: getdevices.py, line 93, Discovering device paths
SPAM: getdevices.py, line 116, Found "Logitech M705", /dev/input/event11, usb-0000:00:1d.2-1
SPAM: getdevices.py, line 116, Found "HP WMI hotkeys", /dev/input/event7, wmi
SPAM: getdevices.py, line 116, Found "ST LIS3LV02DL Accelerometer", /dev/input/event6, lis3lv02d
SPAM: getdevices.py, line 116, Found "SynPS/2 Synaptics TouchPad", /dev/input/event5, isa0060
SPAM: getdevices.py, line 116, Found "Video Bus", /dev/input/event4, LNXVIDEO
SPAM: getdevices.py, line 116, Found "AT Translated Set 2 keyboard", /dev/input/event3, isa0060
SPAM: getdevices.py, line 116, Found "Sleep Button", /dev/input/event0, PNP0C0E
INFO: getdevices.py, line 179, Found "Logitech M705", "HP WMI hotkeys", "ST LIS3LV02DL Accelerometer", "SynPS/2 Synaptics TouchPad", "Video Bus", "Sleep Button"
DEBUG: reader.py, line 117, Starting reading keycodes from "Logitech M705"
SPAM: pid 9776, reader.py, line 135, got (1, 272, 1)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 0)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 1)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 0)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 1)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 0)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 1)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 0)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 1)
SPAM: pid 9776, reader.py, line 135, got (1, 272, 0)
DEBUG: window.py, line 184, Closing window
DEBUG: reader.py, line 79, Sending close msg to reader
DEBUG: pid 9776, reader.py, line 158, Reader stopped
DEBUG: window.py, line 184, Closing window

(key-mapper-gtk:9765): Gtk-CRITICAL **: 13:01:15.746: gtk_main_quit: assertion 'main_loops != NULL' failed

@sezanzeb
Copy link
Owner

sezanzeb commented Dec 31, 2020

I mean using the instructions here: https://github.com/sezanzeb/key-mapper#ubuntudebian, involving the git clone

Since I can't see button 6 and 7 in the log, lets go one level deeper and use evtest

run sudo evtest and send me the events caused by your two buttons please (after clicking the defaults button)

@jim8989
Copy link
Author

jim8989 commented Dec 31, 2020 via email

@sezanzeb
Copy link
Owner

I think you copied some sort of previous console output into your terminal

And it seems you didn't execute sudo dpkg -i ./dist/key-mapper-0.4.0.deb

@jim8989
Copy link
Author

jim8989 commented Dec 31, 2020 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Dec 31, 2020

Don't worry!

Copying the instructions line by line, executing each one individually, is the safest way. Copying and pasting multiple at once sometimes doesn't work if one of the commands suddenly expects input.

@jim8989
Copy link
Author

jim8989 commented Dec 31, 2020 via email

@sezanzeb
Copy link
Owner

that one will be fixed be the next command sudo apt -f install

@jim8989
Copy link
Author

jim8989 commented Dec 31, 2020 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 1, 2021

I can't see any attachment

@jim8989
Copy link
Author

jim8989 commented Jan 1, 2021 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 1, 2021

I just filtered the input from mouse-movement events, and this is what is left over:

Event: time 1609522127.108917, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1609522127.108917, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1609522127.300908, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1609522127.300908, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1609522154.899485, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1609522154.899485, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1609522155.077489, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1609522155.077489, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0

So evtest doesn't report mouse 6 and 7. I don't know how xev would be able to detect anything in that case.

Did you make sure to use "Restore Defaults" before running evtest? Or was an injection ongoing?

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 1, 2021

*ah, injection couldn't be active, it would be visible in evtest.

So your mouse buttons don't do anything. Are you sure they are visible in xev?

@jim8989
Copy link
Author

jim8989 commented Jan 1, 2021 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 1, 2021

please run xev | grep button -B2 and try again (EDIT: forget about that, that doesn't show what I thought it shows)

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 1, 2021

it's probably

Event: time 1609522136.349847, type 2 (EV_REL), code 6 (REL_HWHEEL), value -1
Event: time 1609522136.349847, type 2 (EV_REL), code 12 (REL_HWHEEL_HI_RES), value -120

then. very interesting. key-mapper can't map that yet indeed. I'm currently working on something somewhat similar with gamepad joysticks, I'll probably include a way to map scroll wheel actions

@jim8989
Copy link
Author

jim8989 commented Jan 1, 2021 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 2, 2021

The difficulty is, that mice don't report end events for that. So I'll have to detect the end of that myself. Some experimental stuff exists but I need to think about it for some more time. I also think I need a break after working almost non-stop on key-mapper in my free time for over two months.

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 2, 2021

Try this branch please:

https://github.com/sezanzeb/key-mapper/tree/wheel-attempt-2

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 3, 2021

Ah, I forgot to mention, the git clone command changes if you want to clone a different branch to:

git clone -b wheel-attempt-2 https://github.com/sezanzeb/key-mapper.git

@sojusnik
Copy link

sojusnik commented Jan 5, 2021

Same here on a Logitech M590.

$ xev | grep button
    state 0x0, button 6, same_screen YES
    state 0x0, button 6, same_screen YES
    state 0x0, button 7, same_screen YES
    state 0x0, button 7, same_screen YES

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 5, 2021

@sojusnik please try this branch: git clone -b wheel-attempt-2 https://github.com/sezanzeb/key-mapper.git

nobody gave me feedback yet if it works properly, the feature is basically finished and has unittests. Which distro are you on?

  • For ubuntu: build the deb file
  • For manjaro: try cd key-mapper && sudo pip install .

You'll know if you installed it correctly if "shift + del" activates the "restore defaults" button, because that is also new.

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 5, 2021

well, lets just hope that it works well for everybody. pushed it to main

@sezanzeb sezanzeb closed this as completed Jan 5, 2021
@sojusnik
Copy link

sojusnik commented Jan 5, 2021

For ubuntu: build the deb file

What's the correct way to "build" a .deb file on Ubuntu?

I'm currently using the 0.5.0.deb from here.
Do I have to uninstall this .deb file, before building the updated .deb?

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 5, 2021

https://github.com/sezanzeb/key-mapper#ubuntudebian

no, just build it and install it

I'll make release 0.6.0 possibly next weekend, you'll also get the deb from there

@jim8989
Copy link
Author

jim8989 commented Jan 6, 2021 via email

@sezanzeb
Copy link
Owner

sezanzeb commented Jan 7, 2021

I see, don't worry too much about the stuff here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants