Removed Joystick trackball support.

This commit is contained in:
EliteMasterEric
2023-05-11 20:22:27 -04:00
parent 2b3fe0ac0d
commit a7b83cb688
10 changed files with 3 additions and 82 deletions

View File

@@ -227,10 +227,6 @@ class NativeApplication
var joystick = Joystick.devices.get(joystickEventInfo.id);
if (joystick != null) joystick.onHatMove.dispatch(joystickEventInfo.index, joystickEventInfo.eventValue);
case TRACKBALL_MOVE:
var joystick = Joystick.devices.get(joystickEventInfo.id);
if (joystick != null) joystick.onTrackballMove.dispatch(joystickEventInfo.index, joystickEventInfo.x, joystickEventInfo.y);
case BUTTON_DOWN:
var joystick = Joystick.devices.get(joystickEventInfo.id);
if (joystick != null) joystick.onButtonDown.dispatch(joystickEventInfo.index);
@@ -746,7 +742,7 @@ class NativeApplication
{
var AXIS_MOVE = 0;
var HAT_MOVE = 1;
var TRACKBALL_MOVE = 2;
// var TRACKBALL_MOVE = 2;
var BUTTON_DOWN = 3;
var BUTTON_UP = 4;
var CONNECT = 5;

View File

@@ -213,8 +213,6 @@ class NativeCFFI
@:cffi private static function lime_joystick_get_num_hats(id:Int):Int;
@:cffi private static function lime_joystick_get_num_trackballs(id:Int):Int;
@:cffi private static function lime_joystick_event_manager_register(callback:Dynamic, eventObject:Dynamic):Void;
@:cffi private static function lime_jpeg_decode_bytes(data:Dynamic, decodeData:Bool, buffer:Dynamic):Dynamic;
@@ -495,8 +493,6 @@ class NativeCFFI
private static var lime_joystick_get_num_axes = new cpp.Callable<Int->Int>(cpp.Prime._loadPrime("lime", "lime_joystick_get_num_axes", "ii", false));
private static var lime_joystick_get_num_buttons = new cpp.Callable<Int->Int>(cpp.Prime._loadPrime("lime", "lime_joystick_get_num_buttons", "ii", false));
private static var lime_joystick_get_num_hats = new cpp.Callable<Int->Int>(cpp.Prime._loadPrime("lime", "lime_joystick_get_num_hats", "ii", false));
private static var lime_joystick_get_num_trackballs = new cpp.Callable<Int->Int>(cpp.Prime._loadPrime("lime", "lime_joystick_get_num_trackballs", "ii",
false));
private static var lime_joystick_event_manager_register = new cpp.Callable<cpp.Object->cpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime",
"lime_joystick_event_manager_register", "oov", false));
private static var lime_jpeg_decode_bytes = new cpp.Callable<cpp.Object->Bool->cpp.Object->cpp.Object>(cpp.Prime._loadPrime("lime",
@@ -706,7 +702,6 @@ class NativeCFFI
private static var lime_joystick_get_num_axes = CFFI.load("lime", "lime_joystick_get_num_axes", 1);
private static var lime_joystick_get_num_buttons = CFFI.load("lime", "lime_joystick_get_num_buttons", 1);
private static var lime_joystick_get_num_hats = CFFI.load("lime", "lime_joystick_get_num_hats", 1);
private static var lime_joystick_get_num_trackballs = CFFI.load("lime", "lime_joystick_get_num_trackballs", 1);
private static var lime_joystick_event_manager_register = CFFI.load("lime", "lime_joystick_event_manager_register", 2);
private static var lime_jpeg_decode_bytes = CFFI.load("lime", "lime_jpeg_decode_bytes", 3);
private static var lime_jpeg_decode_file = CFFI.load("lime", "lime_jpeg_decode_file", 3);
@@ -1113,11 +1108,6 @@ class NativeCFFI
return 0;
}
@:hlNative("lime", "hl_joystick_get_num_trackballs") private static function lime_joystick_get_num_trackballs(id:Int):Int
{
return 0;
}
@:hlNative("lime", "hl_joystick_event_manager_register") private static function lime_joystick_event_manager_register(callback:Void->Void,
eventObject:JoystickEventInfo):Void {}

View File

@@ -226,15 +226,6 @@ class Application extends Module
**/
public function onJoystickHatMove(joystick:Joystick, hat:Int, position:JoystickHatPosition):Void {}
/**
Called when a joystick axis move event is fired
@param joystick The current joystick
@param trackball The trackball that was moved
@param x The x movement of the trackball (between 0 and 1)
@param y The y movement of the trackball (between 0 and 1)
**/
public function onJoystickTrackballMove(joystick:Joystick, trackball:Int, x:Float, y:Float):Void {}
/**
Called when a key down event is fired on the primary window
@param keyCode The code of the key that was pressed
@@ -585,7 +576,6 @@ class Application extends Module
joystick.onButtonUp.add(onJoystickButtonUp.bind(joystick));
joystick.onDisconnect.add(onJoystickDisconnect.bind(joystick));
joystick.onHatMove.add(onJoystickHatMove.bind(joystick));
joystick.onTrackballMove.add(onJoystickTrackballMove.bind(joystick));
}
@:noCompletion private function __onModuleExit(code:Int):Void

View File

@@ -20,13 +20,11 @@ class Joystick
public var numAxes(get, never):Int;
public var numButtons(get, never):Int;
public var numHats(get, never):Int;
public var numTrackballs(get, never):Int;
public var onAxisMove = new Event<Int->Float->Void>();
public var onButtonDown = new Event<Int->Void>();
public var onButtonUp = new Event<Int->Void>();
public var onDisconnect = new Event<Void->Void>();
public var onHatMove = new Event<Int->JoystickHatPosition->Void>();
public var onTrackballMove = new Event<Int->Float->Float->Void>();
public function new(id:Int)
{
@@ -125,13 +123,4 @@ class Joystick
return 0;
#end
}
@:noCompletion private inline function get_numTrackballs():Int
{
#if (lime_cffi && !macro)
return NativeCFFI.lime_joystick_get_num_trackballs(this.id);
#else
return 0;
#end
}
}