View Single Post
PinCushionQueen's Avatar
Posts: 538 | Thanked: 168 times | Joined on Dec 2007 @ Seattle
#23
Yes the script should work so that when you press the button(s) you've assigned a screen tap should behave like a right click. Then when you press the same button(s) again - a screen tap goes back to being a left click. It's a toggle.

As for the script... I forgot that my husband rewrote the script for me using sed instead of awk but that really shouldn't matter. The script is correct except I think you need to add the following as the very first line:

#!/bin/sh

If that still doesn't work then you're welcome to try my version of the script:


Code:
#!/bin/sh
BTN=$(/usr/bin/xmodmap -pp | sed -ne 's/^\s\+1\s\+\([[:digit:]]\+\)\s*$/\1/p')
if [ $BTN == 3 ]; then
  MAP='1 2 3'
else
  MAP='3 2 1'
fi
/usr/bin/xmodmap -e "pointer = $MAP" 2>/dev/null
__________________
When you wish upon a star, your dreams really can come true... Unless it's an asteroid hurtling towards earth that will destroy all life.