sixaxis2mouse

YDL running on the Sony Playstation 3

Moderator: billb

sixaxis2mouse

Postby billb » 07 Nov 2010, 18:56

After trying various methods for getting the Sixaxis/Dualshock3 to work for controlling the mouse, I finally gave up and wrote my own application for it. It's written in C, takes only a few KB and a fairly small amount of CPU time (this may be improved in future releases - still learning about the best way to handle the event loop).

At this point there are no command line options to configure it -- currently only /dev/input/js0 is supported and there are no command line options. The left analog stick moves the mouse. The X, O, and Triangle buttons generate Left, Right, and Middle mouse clicks. The mouse speed is tied to the axis value on the analog stick, so moving the analog stick very slightly will allow slow movement of the mouse, and moving it to the fullest extent moves the mouse quickly.

Also there's no signal handler yet so if you start it from a terminal window by itself, Ctrl-C won't stop it. You'd need to close the terminal window it was started from, or use "killall -9 sixaxis2mouse" from another terminal window.

Typical usage is to run before another application and kill on exit.

Example: sixaxis2mouse & firefox && killall sixaxis2mouse

There's no messing with xorg.conf or anything else -- it just works. Mostly. :P

sixaxis2mouse seems to work fine for all applications running in a window, but it has trouble with some when running full screen. For example, you can't use it to control quake2 or alephone. But you can use it to control Pingus. And you can use it to control the menu screen for alephone games like marathon2, just don't enable mouse control support. Also at this point, you can't use it to click-drag or adjust window sizes because it only generates "clicks" (down and up) when you press X, O, or Triangle.

Note that it currently requires xvkbd to generate the mouse clicks and that package is only on ps3bodega for YDL 6.2, so you need to have the ps3bodega repo for YDL 6.2 setup correctly to install it. If you already have that done, then just:
Code: Select all
su

<root password>
Code: Select all
yum install sixaxis2mouse

Code: Select all
exit
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: sixaxis2mouse

Postby Noons » 07 Nov 2010, 20:41

Awesome!! Congrats

I'm almost ready to switch back to 6.2 just to try this :D
Fedora core 12; ps3 CECHA01; samsung 720p plasma; kernel 2.6.32
User avatar
Noons
ydl guru
ydl guru
 
Posts: 300
Joined: 18 Mar 2008, 21:50
Location: Ont. CAN

Re: sixaxis2mouse

Postby billb » 07 Nov 2010, 20:48

It *might* work on 6.1, you'd just need to get xvkbd (virtual keyboard program that can be used from command line to generate mouseclicks, too) installed I think. It also uses Xlib, but that should be available from the 6.1 repos ...

Here's a link to the xvkbd repoview page (ps3bodega YDL 6.2):

http://pleasantfiction.ipower.com/ps3li ... xvkbd.html

And sixaxis2mouse:

http://pleasantfiction.ipower.com/ps3li ... mouse.html

If you want to try installing, then download/install xvkbd first, then sixaxis2mouse after (download RPM package to Desktop, then double-click to open in software installer).
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: sixaxis2mouse

Postby billb » 28 Nov 2010, 17:15

Version 1.2 adds: D-Pad for arrow keys, PS for Ctrl-Q (used for quitting many applications)
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: sixaxis2mouse

Postby billb » 22 Jul 2011, 14:11

Working on a much improved version of this program now ...

* Smoother mouse movement
* Adjustable mouse speed
* Much Less CPU usage (went from as much as 7% down to around 0.3-0.7%)
* No longer generates mouseclicks only -- can hold down mouse button to drag windows around, use scroll bars, etc.
* Configurable via command line or specified config file so other joysticks can be used / button layout can be changed
* Signal handler implemented (so Ctrl-C stops it)
* Can define custom commands to run at the press of any specified button
* Now works properly with Battle for Wesnoth
* Makefile included
* Mousewheel support
* Joystick axis deadzone can be specified
* Can define custom keystrokes (including Shift, Ctrl, Alt and Meta modifiers) for any button
* Xvkbd no longer used for mouseclicks or keystrokes (though it can still be used by specifying a custom command)

Latest development discussed here:
http://pleasantfiction.ipower.com/bodeg ... 05&start=0

We still have trouble with SDL applications that "grab" the mouse -- the mouse pointer tends to go haywire on those (e-uae, dosbox, etc).

Thanks to René Reucher (developer of qmc2 mame/mess frontend) for all the improvements! I think I have a line or two of code left in there ... :mrgreen:
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA


Return to Playstation 3

Who is online

Users browsing this forum: No registered users and 13 guests