11a80
![]() |
|
|
|
|
|||||||
| Multimedia Having problems running your new shiny and blinking gadget or watching DVDs, listening to CDs etc.? |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi everyone,
Last July, I wrote a program called Joytran, which translates joystick events to keyboard and mouse events. It has been available in the ports tree (emulators/joytran) since 2011 October, but it occurred to me that my target audience of *BSD users (specifically FreeBSD) are likely unaware of its existence. Such a program is important for people who like to play games or use a joystick in emulators/wine, emulators/virtualbox-ose, or applications that use linux emulation. Due to the fact that devel/linux-js does not work on FreeBSD versions 8.x or newer, [1] I became motivated to write this program. It effectively allows you to create customizable joystick support for any application that uses the keyboard and mouse, and may be closed when you want to run an application that has proper joystick support, such as emulators/zsnes. The alternative which I typically see people mention on BSD message boards is "native" Xorg joystick to keyboard/mouse translation, which I found to be very limiting. It does not allow to change profiles on the fly without restarting the Xserver, [2] fails to recognize joystick "hats" properly, and performs poor axis translation. [3] Previously the documentation was very minimal, [4] but now most aspects of the program are thoroughly documented, and in version 0.8.7, it is no longer necessary to write your own joystick profiles, thus making the program far easier to use than in prior versions. Currently, it has been tested with PlayStation®2 joystick adaptors, but I believe that it should work with most types of joysticks with ease. Anyway, I'm eager to hear about any bugs or issues that people have with the program, so if you have any problems, questions, suggestions, critiques, or death threats, please send me an email message. (I will set up a mailing list as well if there is sufficient demand) There is a fossil repository as well as a FreeBSD port (emulators/joytran) available. Regards, Tim -------------------------------------------------------------------------------- [1] This is due to the change to the new USB stack. Since devel/linux-js is a non-trivial application, the maintainer of that software or someone who is experienced in both joystick APIs would need to rewrite it. [2] Hotplug should be possible, but I couldn't figure out how to get HAL working; it is not clear to me if HAL hotplug functionality ever worked on FreeBSD for joysticks. It is also deprecated by our friends at freedesktop.org, which destroyed my incentive to understand HAL. [3] It doesn't handle diagonal movement gracefully, whereas emulators/joytran does. [4] In fact, the only mention of the program that I found on google was in the PC-BSD forums where a user stated that they were unable to get the program working and moved on. Sorry about that, hopefully it should be easier to use now!
Last edited by DutchDaemon; April 4th, 2012 at 09:49. Reason: [port] tags |
|
#2
|
|||
|
|||
|
Thank you for heads-up. I could use this program, since I have a dedicated FreeBSD machine running DosBOX / ZSNES
The plan was to program a nice graphical menu and use joystick for control. However since most DOS games require keyboard, I fell back to running full screen xterm. If I ever revert to original plan, I'll remember your work
|
|
#3
|
|||
|
|||
|
Cool, well if you try it out and run into problems, don't hesitate to contact me.
|
|
#4
|
||||
|
||||
|
Hi Timothy,
I tried joytran without any luck with a PS3 controller connected via USB. No events are shown in xev. Using the default-one_player config file: Code:
joytran -b -v -p default-one_player using profile in file: /usr/local/share/joytran/profiles/default-one_player running in background Initializing SDL. SDL initialized. joy 0 configured: ready Code:
usbhidctl -f /dev/uhid0 -r Report descriptor: Collection type=Application page=Generic_Desktop usage=Joystick Collection type=Logical page=Generic_Desktop usage=Joystick Input rid=1 size=1 count=1 page=Button usage=Button_1, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_2, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_3, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_4, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_5, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_6, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_7, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_8, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_9, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_10, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_11, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_12, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_13, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_14, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_15, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_16, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_17, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_18, logical range 0..1, physical range 0..1 Input rid=1 size=1 count=1 page=Button usage=Button_19, logical range 0..1, physical range 0..1 Collection type=Physical page=Generic_Desktop usage=Pointer Input rid=1 size=8 count=1 page=Generic_Desktop usage=X, logical range 0..255, physical range 0..255 Input rid=1 size=8 count=1 page=Generic_Desktop usage=Y, logical range 0..255, physical range 0..255 Input rid=1 size=8 count=1 page=Generic_Desktop usage=Z, logical range 0..255, physical range 0..255 Input rid=1 size=8 count=1 page=Generic_Desktop usage=Rz, logical range 0..255, physical range 0..255 End collection Input rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Input rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Output rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Output rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Feature rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Feature rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Feature rid=1 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 End collection Collection type=Logical page=Generic_Desktop usage=Pointer Feature rid=2 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Feature rid=2 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Feature rid=2 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 End collection Collection type=Logical page=Generic_Desktop usage=Pointer Feature rid=-18 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Feature rid=-18 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Feature rid=-18 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 End collection Collection type=Logical page=Generic_Desktop usage=Pointer Feature rid=-17 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 Feature rid=-17 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 [...] Feature rid=-17 size=8 count=1 page=Generic_Desktop usage=Pointer, logical range 0..255, physical range 0..255 End collection End collection Total input size 49 bytes Total output size 49 bytes Total feature size 49 bytes Last edited by DutchDaemon; May 3rd, 2012 at 00:03. |
|
#5
|
|||
|
|||
|
Wow, I didn't even know that FreeBSD supported PS3 controllers.
I'll test it with my PS3 controller tonight.Does it work properly with regular SDL games like emulators/zsnes or something else SDL based? Also, presuming that it does work, you will need to adjust the profile to add the axis and/or hats as needed for the additional sixaxis controls, and the PS3 button. At the moment, I have no idea what buttons 14-19 are used for, but I'll look into it. Tim |
|
#6
|
||||
|
||||
|
I don't know if they're working, I just plugged mine in and it was presented as a uhid device, so I gave joytrans a try.
Last edited by DutchDaemon; May 4th, 2012 at 00:06. |
|
#7
|
|||
|
|||
|
I think that SDL joystick support is broken for version 1.2.15 of devel/sdl12 on 9.0-RELEASE, on two of my computers. I was unable to use any joystick in any SDL applications on both of my 9.0-RELEASE boxes, so I tried reverting to the cvs revision of 2012-01-15 of the port, and all of my SDL applications (emulators/joytran, SDLJoytest-GL, emulators/zsnes and so on) started working again.
If anyone alse is experiencing this problem, issue the following commands (it might be possible to get a slighly newer revision, but this worked for me, so I didn't bother): tcsh/csh: Code:
> setenv CVSROOT :pserver:anoncvs@anoncvs.tw.FreeBSD.org:/home/ncvs > cvs -Qf export -d sdl12 -D "2012-01-15" ports/devel/sdl12 Code:
$ export CVSROOT=:pserver:anoncvs@anoncvs.tw.FreeBSD.org:/home/ncvs $ cvs -Qf export -d sdl12 -D "2012-01-15" ports/devel/sdl12 |
![]() |
| Tags |
| freebsd, games, joystick, virtualbox, wine |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Announcing VirtualBSD 9.0 | karunko | Off-Topic | 0 | January 19th, 2012 09:13 |
| [Solved] game emulators | minke | Multimedia | 5 | December 10th, 2010 00:13 |
| [Solved] cannot install emulators/linux_base-f10 | ccc | Installation and Maintenance of FreeBSD Ports or Packages | 4 | September 12th, 2010 01:00 |
| submitting a port (emulators/linux_dist-gentoo-stage3) | lifanov | Porting New Software | 1 | February 8th, 2010 08:27 |
| Mouse scroll behavior on terminal emulators | madmix | X.Org | 1 | January 21st, 2010 07:18 |