Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/StackAndHeap/joystick-ane
Adobe AIR Native Extension Joystick Library
https://github.com/StackAndHeap/joystick-ane
Last synced: about 2 months ago
JSON representation
Adobe AIR Native Extension Joystick Library
- Host: GitHub
- URL: https://github.com/StackAndHeap/joystick-ane
- Owner: StackAndHeap
- Created: 2013-02-10T20:48:08.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-10T21:15:28.000Z (almost 12 years ago)
- Last Synced: 2024-08-04T05:03:19.866Z (5 months ago)
- Language: ActionScript
- Size: 12.8 MB
- Stars: 18
- Watchers: 10
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actionscript-sorted - joystick-ane - ANE Joystick Library (Native Extension / Hardware ANE)
README
Joystick Library for Adobe AIR
==============================Adobe AIR Native Extension
This library enables you to extend the Adobe AIR runtime with native support for working with joysticks and gamepads. Currently the library supports only Windows.
To build the extension and the sample application, simply run the build.xml Ant script.
Example usage
-------------var joystickManager:JoystickManager = new JoystickManager();
joystickManager.addEventListener( JoystickEvent.CONNECTED, ext_connectedHandler );
joystickManager.addEventListener( JoystickEvent.DISCONNECTED, ext_disconnectedHandler );
joystickManager.addEventListener( JoystickEvent.MOVE, ext_moveHandler );
joystickManager.addEventListener( JoystickEvent.PRESS, ext_pressHandler );
joystickManager.addEventListener( JoystickEvent.RELEASE, ext_releaseHandler );
private function ext_connectedHandler( event:JoystickEvent ):void {
trace( "Joystick " + event.index + " connected" );
}
private function ext_disconnectedHandler( event:JoystickEvent ):void {
trace( "Joystick " + event.index + " disconnected" );
}
private function ext_moveHandler( event:JoystickMoveEvent ):void {
trace( "Axis " + event.axisIndex + " moved to value " + event.value + " (raw value: " + event.rawValue + ") on joystick " + event.index );
}
private function ext_pressHandler( event:JoystickButtonEvent ):void {
trace("Button " + event.buttonIndex + " pressed on joystick " + event.index );
}
private function ext_releaseHandler( event:JoystickButtonEvent ):void {
trace( "Button " + event.buttonIndex + " released on joystick " + event.index );
}