Comment 41 for bug 418470

Revision history for this message
mark bower (mjbower) wrote :

O.K. The following code when executed "delinks" the mouse pointer from joystick movements. The sequence: 1)open a terminal, 2)enter the script file on the cmd line, 3)plug in the rc-controller(see the mouse move to left), 4)with some skill get the uncooperative mouse cursor to pass over the terminal screen and click on it to make it active, 5)hit return to execute the script. And voilla, the cursor returns to normal behavior.

Code:

#!/bin/bash
#file: script_rccontroller.sh
#use to disable mouse emulation from controller sticks(joysticks)
#get NAME for controller from xinput list

NAME='WAILLY PPM'

ids=$(xinput list | grep "$NAME" | grep -o -e "id=.." | xargs | sed "s/id=//g")
for id in $ids; do
    echo "Disabling Mouse/Key events for ID $id"
    xinput set-prop $id "Generate Mouse Events" 0
    xinput set-prop $id "Generate Key Events" 0
done

But even tho the code works, I get the two error msgs:
property Generate Mouse Events doesn't exist, you need to specify its type and format
property Generate Key Events doesn't exist, you need to specify its type and format

Can anyone suggest the syntax to eliminate these error msgs. And again, please refer to the link (item 36) in my 1st post to see what I am trying to adapt for my use.