Skip to content

Commit

Permalink
Sync SDL2 header -> wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Oct 27, 2024
1 parent 9757d14 commit 561175e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SDL2/SDL_ControllerDeviceEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ typedef struct SDL_ControllerDeviceEvent
} SDL_ControllerDeviceEvent;
```

## Remarks

Joysticks that are supported game controllers receive both an
[SDL_JoyDeviceEvent](SDL_JoyDeviceEvent) and an
[SDL_ControllerDeviceEvent](SDL_ControllerDeviceEvent).

SDL will send CONTROLLERDEVICEADDED events for joysticks that are already
plugged in during [SDL_Init](SDL_Init)() and are recognized as game
controllers.

----
[CategoryAPI](CategoryAPI), [CategoryAPIStruct](CategoryAPIStruct), [CategoryEvents](CategoryEvents)

6 changes: 6 additions & 0 deletions SDL2/SDL_GameControllerAddMapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ This string shows an example of a valid mapping for a controller:
"341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
```

If this function is called before [SDL_Init](SDL_Init), SDL will generate
an [SDL_CONTROLLERDEVICEADDED](SDL_CONTROLLERDEVICEADDED) event for
matching controllers that are plugged in at the time that
[SDL_Init](SDL_Init) is called.

## Version

This function is available since SDL 2.0.0.
Expand All @@ -50,6 +55,7 @@ This function is available since SDL 2.0.0.

- [SDL_GameControllerMapping](SDL_GameControllerMapping)
- [SDL_GameControllerMappingForGUID](SDL_GameControllerMappingForGUID)
- [SDL_CONTROLLERDEVICEADDED](SDL_CONTROLLERDEVICEADDED)

----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryGameController](CategoryGameController)
Expand Down
6 changes: 6 additions & 0 deletions SDL2/SDL_GameControllerAddMappingsFromRW.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ database files.
If a new mapping is loaded for an already known controller GUID, the later
version will overwrite the one currently loaded.
If this function is called before [SDL_Init](SDL_Init), SDL will generate
an [SDL_CONTROLLERDEVICEADDED](SDL_CONTROLLERDEVICEADDED) event for
matching controllers that are plugged in at the time that
[SDL_Init](SDL_Init) is called.
Mappings not belonging to the current platform or with no platform field
specified will be ignored (i.e. mappings for Linux will be ignored in
Windows, etc).
Expand All @@ -50,6 +55,7 @@ This function is available since SDL 2.0.2.
- [SDL_GameControllerAddMapping](SDL_GameControllerAddMapping)
- [SDL_GameControllerAddMappingsFromFile](SDL_GameControllerAddMappingsFromFile)
- [SDL_GameControllerMappingForGUID](SDL_GameControllerMappingForGUID)
- [SDL_CONTROLLERDEVICEADDED](SDL_CONTROLLERDEVICEADDED)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryGameController](CategoryGameController)
Expand Down
9 changes: 9 additions & 0 deletions SDL2/SDL_JoyDeviceEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ typedef struct SDL_JoyDeviceEvent
} SDL_JoyDeviceEvent;
```

## Remarks

SDL will send JOYSTICK_ADDED events for devices that are already plugged in
during [SDL_Init](SDL_Init).

## See Also

- [SDL_ControllerDeviceEvent](SDL_ControllerDeviceEvent)

----
[CategoryAPI](CategoryAPI), [CategoryAPIStruct](CategoryAPIStruct), [CategoryEvents](CategoryEvents)

0 comments on commit 561175e

Please sign in to comment.