in Linux (in a terminal window).
run
- ./joystickLinux.sh
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()).
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