• Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 590 from 2010/2/10
    From: FRANCE
    Hi,

    I try to implement sensors in SDL2 library.
    Original code : https://github.com/BSzili/SDL/blob/mos-sdl2/src/joystick/morphos/SDL_sysjoystick.c

    I have a PS4 gamepad connected (xbox360.class on trident) to test.

    I have a lot of questions : i try to explain, sorry for my english.....

    1. initialization of sensors ?

    Code:

    static const size_t sensortags[] = { SENSORS_Class, SensorClass_HID, SENSORS_Type, SensorType_HID_Gamepad, TAG_DONE };
    sensorlist = ObtainSensorsList((struct TagItem *)&sensortags), sensor = NULL;


    After MorphOS startup, i need to launch Trident to see my controller into Sensorlist.
    Exist any code to initialize sensors ?
    in library i open library here : https://github.com/BSzili/SDL/blob/mos-sdl2/src/core/morphos/SDL_library.c#L384

    2. when i see my controller :

    In original code of Itix, SENSORS_HID_Serial return nothing ?!

    Code:

    CONST_STRPTR serial = NULL;
    size_t qt[] = { SENSORS_HIDInput_Name_Translated, SENSORS_HID_Serial, (size_t)&serial, TAG_DONE };


    In trident, same i dont have Serial (serial #: n/a), so how to generate a serial ?

    3. Examples sensors.library codes

    I search somes examples how use sensors.library but it's really rare....
    I only find : https://bitbucket.org/BSzili/joysensors/src/master/joysensors.c

    Done for this first step..

    Thanks you
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »21.04.20 - 08:17
    Profile Visit Website