Git Product home page Git Product logo

gdx-controllerutils's Introduction

gdx-controllerutils's People

Contributors

azania avatar born2snipe avatar fourlastor avatar klianc09 avatar ktar5 avatar mrstahlfelge avatar rafaskb avatar tomcashman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gdx-controllerutils's Issues

iOS MFI controller implementation testers needed

The iOS MFI controller implementation is working and therefore pulled to the master branch. However, I could only test on a single device and controller, an iPhone 5s on iOS 12.2 with Logitech PowerShell Controller via Lightning. Everything is working as expected, but this controller has no analogue sticks (is not "extended" in Apples spec).

I released a beta build of my game and two users tested with a SteelSeries Nimbus via bluetooth. All iOS 12.2. User on an iPhone10,5 (= iPhone 8 Plus) said everything was working as expected, user on an iPhone10,6 (= iPhone X) said dpad was not working at all and analogue sticks where only working on polling, not with ControllerListeners.

Would be great if other libGDX devs working with RoboVM and having an MFI controller could test this.

Could not resolve Jamepad dependencies

Switch to sdl2gdx instead Jamepad

Since Jamepad as a direct wrapper of SDL is not maintained any more and is now just a wrapper for sdl2gdx, there's the need to switch over to use sdl2gdx internally in the future.

Why not just use sdl2gdx alone? Because it does not implement AdvancedController interface, but is designed for desktop use only. Thus all extended features won't work on cross-platform projects.

Problem: sdl2gdx is not just a wrapper for SDL, but also comes with the hacks we used here to replace libgdx own controller implementations. That means, just pulling in sdl2gdx will not work because of dublicate classes. Ways to solve this:

  • jar jar links, which can be also used to strip the unneeded stuff
  • own fork of the project (best was id GitHub Actions could be used to build the natives) without the unneeded stuff
  • own fork of the project, changed to implement AdvancedController interface

Funky interactions with SelectBox lists

I'm making a game that's meant to be played only with a controller (or keyboard) and I'm currently working on the options screen. The problem is that when I open the SelectBox the input goes to the other buttons first, and only scrolls through the list once I get to the top/bottom of the options behind it. If I try to choose an option, it just activates the other selected button instead of choosing an option.

App crashes on disconnect on MacOS, fixed with latest Jamepad

Hi, thanks for all your work! I have recently started porting to your library (Jamepad impl) from lwjgl3 and things seem to be working with the exception that the app crashes if I remove the controller.

I get this error in my console:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff3a727c18, pid=35485, tid=775
#
# JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C  [IOKit+0x39c18]  IOHIDDeviceGetValue+0xc
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/kenny/workspace/ninjaturdle/hs_err_pid35485.log
Compiled method (nm)    9582 1408     n 0       com.studiohartman.jamepad.ControllerManager::nativeControllerConnectedOrDisconnected (native)
 total in heap  [0x000000012171ef10,0x000000012171f2b8] = 936
 relocation     [0x000000012171f088,0x000000012171f0b8] = 48
 main code      [0x000000012171f0c0,0x000000012171f2b0] = 496
 oops           [0x000000012171f2b0,0x000000012171f2b8] = 8
Compiled method (c1)    9582 1406       3       de.golfgl.gdx.controllers.jamepad.support.JamepadControllerMonitor::run (25 bytes)
 total in heap  [0x000000011a426b90,0x000000011a427498] = 2312
 relocation     [0x000000011a426d08,0x000000011a426d90] = 136
 main code      [0x000000011a426da0,0x000000011a4271c0] = 1056
 stub code      [0x000000011a4271c0,0x000000011a427298] = 216
 oops           [0x000000011a427298,0x000000011a4272a0] = 8
 metadata       [0x000000011a4272a0,0x000000011a4272d8] = 56
 scopes data    [0x000000011a4272d8,0x000000011a427350] = 120
 scopes pcs     [0x000000011a427350,0x000000011a427430] = 224
 dependencies   [0x000000011a427430,0x000000011a427440] = 16
 handler table  [0x000000011a427440,0x000000011a427470] = 48
 nul chk table  [0x000000011a427470,0x000000011a427498] = 40
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I haven't done much further debugging but was curious if this was something you recognized.

LibGDX 1.9.9

JamepadController Usage

Hi!
I'd like to use the 'desktop-jamepad' project to get all controllers correctly mapped automatically.
But I don't understand how I can do this, since I still need to access the buttons by id, since it is just a wrapper over the libgdx controllers interface.

Digging into the code I saw that there exists a JamepadController, but I'm still not sure what is the intended way to access gamepad buttons independent of hardware button id mapping.

Any help or pointers would be highly appreciated.

PS: Also would like to know if it could work with the LWJGL3 backend too, or if LWJGL2 backend is required. I can open a separate issue for this if preferred.

0.3.0 Incorrect Controller Detected

My "Retrolink SNES Controller" is being detected as "Retrolink Saturn Classic Controller".

When I run the SDL2 Gamepad Tool I can see that the correct mapping exists:

"Retrolink SNES Controller", 03000000790000001100000010010000 (mapping available)

I searched the gamecontrollerdb.txt just to make sure, and it does in fact exist.
line 533

Also, is there a gradle task for running the jamepad test app to debug locally?

Controller.getName() should work with disconnected controllers

Using the default libgdx controller implementation, I used to show the name of the controller that disconnected in the ControllerListener. However when using the jamepad implementation on desktop, it makes a native call to the SDL layer whenever retrieving the name, which of course will no longer work in the "disconnected" event handler when the controller is already disconnected. Which causes a disconnected() event to be fired, which triggers my listener again which results in a Stackoverflow eventually.

I know I can workaround that by querying the name of the controller upon connect() and store it in a map, to later retrieve it for the disconnect message. But I feel like that's something the library should do for me. As far as I understand, the name of a controller can't change anyway, so the JamepadController should just query its name in the beginning and then just return a local field anytime somebody calls getName(). As I see it, there is no need to call into the SDL layer each time getName() is called.

Add new buttons supported by iOS 13

The following buttons were added:

var buttonMenu: GCControllerButtonInput (since iOS 13, buttonStart)
var buttonOptions: GCControllerButtonInput? (since iOS 13, buttonBack)
var leftThumbstickButton: GCControllerButtonInput? (since iOS 12.1, leftStick)
var rightThumbstickButton: GCControllerButtonInput? (since iOS 12.1, right stick)

setPausedHandler is deprecated, should be removed for iOS 13 and handled by Start Button.

Mapping display names

Hi :)

So far this library has worked amazing btw. My current question is how do i get a display name for the buttons per controller. For example, on PS4 the A button is really the X button, and the Y button is actually the Triangle button.

I'm wanting to display these names so user's can see what keys map to what in the pause screen. Currently I'm about to write my own mini library of a few key mapping display names.

setFocusedActor(null) does not work, only returns false, can't unset the current focused actor

ControllerMenuStage#setFocusedActor(Actor actor) on line 140/141:
..
if (actor == null || !isActorFocusable(actor))
return false;
..

This causes unable to set the current focused actor to null. Based on the ControllerMenuStage#unfocus(Actor actor) and unfocusAll() this is supposed to be possible as they also set setFocusedActor(null); but this isn't possible as it just returns false without setting it to null. This is most prevalent with onControllerDefaultKeyUp from the IControllerActable interface which will still work even after clearFocusableActors(); meaning you can keep on spamming the button without any way to stop it.

null focusable actor causes nullpointer exception isActorFocusable

As title says. When an actor that is in the focusableActors array becomes null it will crash with a nullpointer exception rather than just return false and possibly remove it from the array.

Exception in thread "main" java.lang.NullPointerException
at de.golfgl.gdx.controllers.ControllerMenuStage.isActorFocusable(ControllerMenuStage.java:202)

While I am at it. addFocusableActor(Actor actor) also allows null to be put in causing the exception as well when you want to focus on it. Perhaps a null check needs to be added there as well?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.