Joystick support for Linux

Linux specific questions and discussion

Joystick support for Linux

Postby tintran » Mon Aug 22, 2011 6:01 am

I hope this is useful.
in Linux (in a terminal window).
run
    ./joystickLinux.sh
Then in GameEditor if you load up the .ged, you can control the test items on the screen(see attached img.) with your joysticks 1 and 2
in the .ged there is a single global script that has 4 functions that you can use
Code: Select all
GetJoystick1LinuxAxis(int axisIndex)
GetJoystick1LinuxButton(int buttonIndex)
GetJoystick2LinuxAxis(int axisIndex)
GetJoystick2LinuxButton(int buttonIndex)

index for buttons are from 0-11 (will return 0 or 1)
index for axis are from 0-5 (will return -32767 to 32767).

so why did I have to write .c files and run them outside of Game Editor?
  • GE can only read files that are in the same directory as the game. (can be solved by creating symbolic link to these files using 'ln -s /dev/input/js0 js0'
  • now able to read from js0/js1 (symbollic link) but reading js0/js1 from a test actor's Draw Actor suspends all other actors's animations, and so far i haven't been able to find nonblocking fopen().
  • see if i can use open() in GE (there are nonblocking flags related to open()).
If you can think of a way to do that some how, please let me know.

This is here because i want to allow joystick support on Linux for this: viewtopic.php?f=6&t=10888&p=75334&hilit=Tetris+Partner#p75334
Attachments
joystickLinux.zip
(211.18 KiB) Downloaded 222 times
JoystickforLinuxTest.png
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Joystick support for Linux

Postby tintran » Thu Aug 25, 2011 5:57 am

Gimp Plugin to help dividing tiles and rotate tiles.
dividing tile cuts up an image that contains multiple frames into new single frame images.
rotate tile will rotate an image into new layers so you can do further editing.

Installation instructions:
1) gimptool-2.0 --install dividetile.c
2) gimptool-2.0 --install rotatetile.c
3) gimptool-2.0 --install horstitch.c
4) gimptool-2.0 --install verstitch.c
5) then add text file that's named "tile.config" and have these values in it

HORIZONTALTILES 3
VERTICALTILES 1
ROTATIONS 5
START_STITCH_FROM_BOTTOM_LAYER 1

and put it where you execute "gimp &" from or I just have under my home/username/ folder
----------------------------------------------------------------------------------------------------------------------------------
and have it opened so you can change numeric values to whatever you like. these values are shown as example to represent what the screenshots are showing.
then in Gimp, they'll be available under Filters->Misc->...
Attachments
vertical_stitch.jpg
horizontal_stitch.jpg
divrothorver.zip.zip
(7.22 KiB) Downloaded 194 times
Screenshot-2.jpg
Screenshot-1.jpg
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score


Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest

cron