Logitech G300 fixes

Logitech G300 mouse jump fix

The Logitech G300 mouse is not working on linux systems out of the box correctly. It jumps to the top left corner when the mouse is pressed.

I've found two solutions on different websites. You can find the sources below. I merged both ideas which works great in the .bash_profile.

#!/bin/sh
DEVICE_ID=`xinput list |  grep "Logitech Gaming Mouse G300" | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'`

if xinput -list-props $DEVICE_ID | grep "Device Enabled" | grep "1$" > /dev/null
then
   xinput set-mode $DEVICE_ID RELATIVE
fi

ArchLinux Tipp: disable the keyboard part of the mouse

Source: https://wiki.archlinux.org/index.php/Logitech_G300

G300 is recognized as both mouse and keyboard by system, you could check by execute:

xinput list | grep G300

We have to disable the G300 keyboard to make it work correctly.

Here's the code:

#!/bin/sh
DEVICE_ID=`xinput list |  grep "Logitech Gaming Mouse G300" | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'`

if xinput -list-props $DEVICE_ID | grep "Device Enabled" | grep "1$" > /dev/null
then
   xinput set-int-prop $DEVICE_ID "Device Enabled" 8 0
fi

Simply execute the code above to see if it's working.

And you could put it into your xinitrc.d (or .bash_profile) to make it load automatically.

Answers on http://vniup.com/index.php/ubuntu/logitech-g300-not-working-on-ubuntu.html

8 January 2012: Answer by drel for Logitech G300, not working on Ubuntu -

I have found a more convenient workaround for the issue and maybe why it works fine on Fedora. I have just set the mode of the keyboard part of the mouse to relative. In my case:

xinput set-mode 12 RELATIVE

Where 12 is the ID of the g300 keyboard. Now that I have done that my mouse recognizes the keys the way I mapped them with the Logitech software under Windows.

Hope that helps you, guys get a better use of the mouse.

Cheers. 18 November 2011: Answer by Tomas for Logitech G300, not working on Ubuntu -

Okay, I digged some further into the issue. I already suspected the programmability of the G300 might have something to do with it. And when you enter

xinput list, it shows the G300 as both a mouse and a keyboard. In my case the G300 keyboard entry has id 12.

xinput list-props 12 gives all properties of the G300 keyboard. It includes this line:

    Device Enabled (146): 1

which means that if we set the property with id 146 to a value of 0 for device id 12, the G300 keyboard is disabled.

Using

xinput set-prop 12 146 0

Map mouse buttons for left hand use - xfce (X11)

DEVICE_ID=`xinput list |  grep "Logitech Gaming Mouse G300" | grep pointer | sed 's/.*id=\([0-9]*\).*/\1/'`
if xinput -list-props $DEVICE_ID | grep "Device Enabled" | grep "1$" > /dev/null
then
    xinput set-mode $DEVICE_ID RELATIVE
    xinput set-button-map $DEVICE_ID 3 2 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
fi

another one from http://crunchbanglinux.org/forums/topic/1760/easy-way-to-invert-leftright-mouse-buttons/:

# left-handed mouse (or the name you want).
xmodmap -e "pointer = 3 2 1"

or

#!/bin/bash

current=$(xmodmap -pp | head -5 | tail -1 | awk '{print $2}');

if [ "$current" -eq "1" ]
then 
        xmodmap -e "pointer = 3 2 1";
else
        xmodmap -e "pointer = 1 2 3";
fi
 
 
         
         
   
(16530 views) logitech_g300_linux.txt · Zuletzt geändert: 2012/08/16 13:10 von terminar