WINDOW_RESIZE Event in Linux

On Linux in Nativepplication when i resize a window its passing a type of 7 (also 6 WINDOW_LEAVE, but that makes more sense) in the event. with according to the enum is WINDOW_MINIMIZE, which makes no sense in context. I’m wondering if SDL or what ever the windowing system we are using for linux is passing different events than linux. this is using the latest lime and the latest hxcpp. haxe 3.2. 64-bit linux system.

Setting WINDOW_MINIMIZE to 9 and WINDOW_RESIZE to 7 fixes the issue of native target not reporting resize on linux. but i’m not sure if thats a proper solution.

Either this is a problem with SDL, or a problem that occurred because of a non-clean build happening. What version of Lime are you using? Lime 2.4.1 was released because 2.4.0 was not a clean build and caused some issues

I’m building from source. so are there some steps i need to do to ensure it was a clean build.

Not sure if related, but no Gamepad event are coming through either in the handleGamepadEvent function.

try lime rebuild windows -clean, or whichever platform you are on. Also, run git submodule init && git submodule update to make sure the submodules are up-to-date, just to be sure

That seemed to fix. when i built the events seem right. the gamepadevents still aren’t triggering, have those recently broke on linux?

So with a clean build, and current update, it’s all working except for gamepad input?

Joystick input should work on Linux, the game controller API in SDL is just a wrapper around it. Looking at the sources, it seems to handle joystick input differently if the SDL libudev define is active, but it seems like it would/should work regardless?

pulled the latest on hxcpp. lime, and openfl. init and update submodule on lime. rebuild hxcpp (neko build.n clean linux then neko build.n linux). then rebuild lime (lime rebuild linux -64 -clean). But handleGamepadEvent in NativeApplication is never trigger. and no events seem to trigger on my JoystickEvent on my event listerners.

Hmm, I’ll have to try and see if it works here. I wonder if anyone else has not been able to use a gamepad on Linux

Found it.

You are using gamepad events and sdl2 doesn’t have all the gamepad registered.

i added the following under sdlapplication


        printf ("Could not initialize SDL: %s.\n", SDL_GetError ());
   //Add Logitech game pad
    const char * CustomMappings = "030000006d04000016c2000010010000,Logitech Logitech Dual Action,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3";

    if(SDL_GameControllerAddMapping(CustomMappings) == -1)
      printf ("Could not Get Custom Mappings SDL: %s.\n", SDL_GetError ());

Then the gamepad events trigger.

if there a way to add the GameControllerDB through a text file that would be great.
(with a way to add more since, i found at least one more mapping that needs to be added).

otherwise you have to add the mapping individually through the code like i did above.

Also it might be cool, if the gamepadevent didn’t trigger you could trigger the joystick event. Like in the joystick event
if (!SDL_IsGameController (event->cdevice.which)) { //SomeJoystickEventFires}
or something like that.

I would be happy to hear suggestions for a place to expose custom game pad binding support in the Lime API, hopefully so we can also add this on other platforms