Change nub behaviour with pyrainput to control mouse cursor with right nub


jedi23

Very Active Member
Joined
Aug 11, 2020
Messages
230
I want to swap the mouse control behaviour of the left and right nub, so that i can move the curser with the right nub.
I looked into the funkeymonkey-pyrainput package. There is a /etc/pyrainput.cfg file and the readme provides possible configurations for it.

So I inserted this into the pyrainput.cfg

Code:
nubs.right.x            = [*mouse_x*|mouse_y|mouse_btn|scroll_x|scroll_y]+
nubs.right.y            = [mouse_x|*mouse_y*|mouse_btn|scroll_x|scroll_y]+
nubs.left.x            = [mouse_x|mouse_y|*mouse_btn*|scroll_x|scroll_y]+
nubs.left.y            = [mouse_x|mouse_y|mouse_btn|scroll_x|*scroll_y*]+

and reloded the configuration with
Code:
$ systemctl reload pyrainput
but it doesn't work as expected.

Any ideas?
 
Inside a dbp package you should use pyrainputctl
Create a file pyrainput.cfg and next run pyrainputctl overload pyrainput.cfg

I have done like this on Halloween3D game:
nubs.left.x = mouse_btn
nubs.left.y = scroll_y
nubs.right.x = mouse_x
nubs.right.y = mouse_y
nubs.left.click = mouse_left
nubs.right.click = mouse_right

mouse.export = 1

and in the runscript i have done:
#!/bin/bash

pwd=`dirname $(readlink -f "$0")`

cd "$pwd"

echo "--------------------------------------------------------------"
echo "Setting PATH to $pwd:$PATH"
export PATH=$pwd:$PATH

echo "--------------------------------------------------------------"
echo "Setting HOME to $pwd"
export HOME=$pwd
export XDG_HOME_DIRS=$pwd


if [ ! -d "system" ];then
zenity --$zentype --title "Halloween 3D" --width 600 --text "<span color=\"blue\">Halloween 3D Drangonbox Pyra release</span>

<span color=\"red\"Now unpacking Game Datas to appdata....please Wait</span>
<span color=\"red\">This will happen only on the first run !!</span>"
tar xf distrib.tar.gz
fi

if [ ! -e "system/hconfig.cfg" ];then
cp hconfig.cfg.sav "system/hconfig.cfg"
fi

if [ ! -e "$pwd/pyrainput.cfg" ];then
cp "$pwd/pyrainput.sav" "$pwd/pyrainput.cfg"
fi

sudo pyrainputctl overload "$pwd/pyrainput.cfg"

export LIBGL_ES=1

gl4es ./Hallow999 $*

sudo pyrainputctl no-overload

All of this "knowledge" is from studing @ptitSeb scripts :cool:
 
That's just how I had in my mind. But now I don't have to invent the wheel for a second time.
Thank you very much :cool:
 
Back
Top