Commit Graph

618 Commits

Author SHA1 Message Date
ben hoffman
4570549036 Replace calls to the old OnControllerX functions in slate with the new version that has a PlatformUser/InputDevice
#jira UE-147796
#preflight 62a9ef17634e82e5d1e90084
#rnx
#rb dave.jones2

[CL 20670964 by ben hoffman in ue5-main branch]
2022-06-15 11:49:18 -04:00
ben hoffman
a3a9765823 Fix a bug where the app would recursively call itself because there was an implicit cast to int32 from Platform user
#jira none
#rb trivial
#rnx
#preflight skip

[CL 20659254 by ben hoffman in ue5-main branch]
2022-06-14 18:10:17 -04:00
ben hoffman
80850587dd Update SlateApplication and the message handler to take in FInputDeviceId and FPlatformId instead of the old int32 controllerid for controller input
#jira UE-147796
#rb trivial
#preflight 62a8f9dd0c386ccae48c2ae1

[CL 20658936 by ben hoffman in ue5-main branch]
2022-06-14 17:49:49 -04:00
Josh Adams
cf7b982c03 - Fixed more MacOSX*.sdk -> MacOSX.sdk
#rb will.damon
#preflight skip

[CL 20536668 by Josh Adams in ue5-main branch]
2022-06-07 09:25:54 -04:00
ben hoffman
d2c5fbec57 When mapping the legacy int32 controllerID checkif there is already an allocated platform user id for the input device ID. If there is then we can return that instead of allocating a new one. Add a virtual function that will let you specify that we should create a new platform user id if it is a new input device, mapping each input device to a single platform user. This will be the case on some platforms that don't allow multiple input devices per user.
Update SonyControllers to use the known user index as the platform user, this way we will allocate a new platform user for different input devices.

#jira UE-147796
#rb trivial
#rnx
#preflight 629910378f4373181f425f6e

[CL 20474934 by ben hoffman in ue5-main branch]
2022-06-02 16:05:41 -04:00
michael atchison
3d80c7b20a Remove dependence on UGameInstance for update check.
Fall back to using the first logged in account on beacon connection when no other player is found.
Fix resource leak in windows splash screen.

[REVIEW] [at]chris.gagnon, [at]eric.knapik, [at]sam.zamani
#preflight 628e6f2982597362d1061d09

#ROBOMERGE-AUTHOR: michael.atchison
#ROBOMERGE-SOURCE: CL 20372471 via CL 20372807 via CL 20373493 via CL 20373519
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20374253 by michael atchison in ue5-main branch]
2022-05-25 20:44:07 -04:00
ben hoffman
8006b9defb Add a "Primary Platform User" virtual function to allow platforms to define a primary user for things like the keyboard and mouse which there will only be one of. Map the Default Input device to the Primary Platform user upon construction of the device mapper. This gaurantees that there will be a platform user registered for the SlateApplication upon start up.
Add a callback to OnUserLoginChangedEvent to the device mapper. This will provide platforms a hook for when a platform user is logged in or out and allow you to remap any previously paired input devices away from the now logged out user.

#jira UE-147792
#rb david.harvey
#preflight 628d2d25347b7778b6ceb043

[CL 20363459 by ben hoffman in ue5-main branch]
2022-05-25 09:27:37 -04:00
ben hoffman
ec9daec419 Deprecate the core delegates for OnControllerConnectionChange and OnControllerPairingChange in favor of the new IPlatformInputDeviceMapper versions that will allow you to get info about what gamepad specifically has sent input events.
#jira UE-147796
#rb marc.audy
#preflight 628663ca2b53e2be4caf4450

[CL 20285694 by ben hoffman in ue5-main branch]
2022-05-19 15:36:55 -04:00
Devin Doucette
3045e3c75f Logging: Changed CanBeUsedOnPanicThread() to return false by default
The previous default of CanBeUsedOnAnyThread() proved unsafe since some output devices can safely be used on any thread but cannot safely be used during a crash. CanBeUsedOnAnyThread() was used pre-5.1 to control serialization to an output device during a crash, but optimizations in 5.1 have uncovered that some of these were never safe.

#preflight 62856506614041edb7a6de4b
#rb Zousar.Shaker
#rnx

[CL 20280354 by Devin Doucette in ue5-main branch]
2022-05-19 10:39:18 -04:00
David Harvey
9cc4146fbc move HoloLens runtime source to platform extension folder.
#jira UE-149794
#rnx
#rb Jeff.Fisher
#preflight 6284cd49614041edb76395dc

[CL 20258963 by David Harvey in ue5-main branch]
2022-05-18 06:59:59 -04:00
Andrew Davidson
9741042a2b Reduce use of UE_DECLARE_LWC_TYPE macro to improve Intellisense.
Moved Math forward declarations from CoreFwd.h to Math/MathFwd.h
#rb steve.robb
#preflight 62837df43c1cdc59e2b07dd5

[CL 20240602 by Andrew Davidson in ue5-main branch]
2022-05-17 07:05:35 -04:00
mathieu dunlay
d1c9bd0b41 Adding FirstMove events to windows, enabled with "WindowsApplication.EnableFirstTouchEvent"
#ROBOMERGE-AUTHOR: mathieu.dunlay
#ROBOMERGE-SOURCE: CL 20163603 via CL 20164288 via CL 20164397 via CL 20164495 via CL 20164557
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20165691 by mathieu dunlay in ue5-main branch]
2022-05-12 12:13:54 -04:00
ben hoffman
4de38291bf Fix an erroneous space in android input interface
#jira none
#rb trivial
#rnx
#preflight skip

[CL 20145470 by ben hoffman in ue5-main branch]
2022-05-11 14:16:44 -04:00
ben hoffman
e52b6b378a Update the Android input interface to utilize the new Platform Input Device mapper instead of the old CoreDelegates for when input device connection changes happen.
Replace uses of the old "int32 ControllerID" in favor of the new platform input device mapper. The new input device mapper will still call the old CoreDelegates until they are deprecated/removed, so there is no behavioral change here. Using the platform input device mapper will allow us to pass specific Input Device ID's around to slate and the game, so that we can properly route input events to and from specific devices.

#jira UE-147796
#rb david.harvey
#rb Chris.Babcock
#preflight 6273ebe6ca0ad32a967fbd5e

[CL 20144897 by ben hoffman in ue5-main branch]
2022-05-11 13:54:57 -04:00
ben hoffman
e4af12b977 XInputInterface: Replace uses of the old "int32 ControllerID" in favor of the new platform input device mapper. The new input device mapper will still call the old CoreDelegates until they are deprecated/removed, so there is no behavioral change here. Using the platform input device mapper will allow us to pass specific Input Device ID's around to slate and the game, so that we can properly route input events to and from specific devices
#jira UE-147796
#rb david.harvey
#preflight 62741ef72e58cb727dfc2ac8

[CL 20075962 by ben hoffman in ue5-main branch]
2022-05-06 10:56:52 -04:00
ben hoffman
ff61d48be3 Linux Application: Replace uses of the old "int32 ControllerID" in favor of the new platform input device mapper. The new input device mapper will still call the old CoreDelegates until they are deprecated/removed, so there is no behavioral change here. Using the platform input device mapper will allow us to pass specific Input Device ID's around to slate and the game, so that we can properly route input events to and from specific devices
#jira UE-147796
#rb Brandon.Schaefer
#preflight 62741ca6ca0ad32a968784c7

[CL 20062913 by ben hoffman in ue5-main branch]
2022-05-05 15:24:21 -04:00
ben hoffman
05358abfff Mac: Replace uses of the old "int32 ControllerID" in favor of the new platform input device mapper. The new input device mapper will still call the old CoreDelegates until they are deprecated/removed, so there is no behavioral change here. Using the platform input device mapper will allow us to pass specific Input Device ID's around to slate and the game, so that we can properly route input events to and from specific devices
#jira UE-147796
#rb david.harvey
#preflight 6273f70303269096abca9ce1

[CL 20060140 by ben hoffman in ue5-main branch]
2022-05-05 13:18:13 -04:00
Chris Babcock
3cba90fb40 Add r.Mobile.DesiredResX/Y for Android and -mobileresx and -mobileresy commandline overrides
#jira UE-144742
#android
#review @Jack.Porter
#rb Jack.Porter

#preflight https://horde.devtools.epicgames.com/job/6272ceb83e1f2a9d3a903d7a

[CL 20046802 by Chris Babcock in ue5-main branch]
2022-05-04 15:15:55 -04:00
ben hoffman
2c3741269c Update comment in the GenericPlatformInputDeviceMapper to keep the BP lib up to date
#jira UE-147801
#rb trivial
#preflight skip
#rnx

[CL 20008057 by ben hoffman in ue5-main branch]
2022-05-02 10:10:10 -04:00
chris constantinescu
1278a26f76 Low level tests further refactoring and test resource deployment
#preflight 626955ed0d4ac78d716eacf0
#rnx

[CL 19941830 by chris constantinescu in ue5-main branch]
2022-04-27 12:36:35 -04:00
ben hoffman
cee9ba5038 Remove the UE::Input namespace because the types won't be able to be BP exposed if we use namespaces. This is because UHT does not support any namespacing outside of "::Type" for some enums, which wouldn't work for the Device State struct. This renames the FInputDeviceState struct to FPlatformInputDeviceState because without the namespaces it conflicts with an existing slate type now that it outside the namespace.
Move the FPlatformInputDeviceState and EInputDeviceConnectionState declarations to the CoreMiscDefines file so that they can be correctly exported in the NoExports.h file. We need them to be in a different file than the base GenericPlatformInputDeviceMapper.h because we need to keep the APPLICATIONCORE_API on that class, which is not available in the NoExports.h file.

#jira UE-147801
#rb trivial
#rnx
#preflight 62632b02d4489684ed592c34

[CL 19902249 by ben hoffman in ue5-main branch]
2022-04-25 10:27:16 -04:00
james doverspike
58c7d94999 Add support to default RHI based on device id and a list of devices that are capable of updating to avoid prompting users who can't update their drivers
#p4v-cherrypick 19897004

#ROBOMERGE-AUTHOR: james.doverspike
#ROBOMERGE-SOURCE: CL 19896998 via CL 19897000 via CL 19897003 via CL 19897308 via CL 19897311
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19897438 by james doverspike in ue5-main branch]
2022-04-24 14:14:43 -04:00
ben hoffman
5e6e396663 Create the Platform Input Device Mapper. This provides an interface that platforms can use to create a map of Input Devices to their owning PlatformUser. This will allow for granular control of how many input devices are mapped to a single user, which some platforms want to do differently than others. The API can be used to query what devices are mapped to which user, so that you can easily determine which controller should recieve a force feedback event, or which user has pushed a certain button.
- Create the FInputDeviceID struct, which represents a single input device such as a gamepad, keyboard, or mouse. These are globally unique, and allocated by the Platform Input Device Mapper. This struct will replace the old "int32 ControllerID" that is used in various places to provide some type safety and maintainability.

- Functions to query all the currently connected devices on a given platform, as well as get their current state and owning platform users. These can be exposed to blueprints via the local player, game instance, or even a subsystem in the future. See UE-147801 for progress on Blueprint Support.

- New delegates for the ConnectionChange and PairingChange of a gamepad device that utilize the new FInputDeviceId and FPlatformUserId

- Add functions to the GenericApplicationMessageHandler for the "OnController_X" functions. These will be implemented later when I can replace the old uses of the "int32 ControllerId". See UE-147796.


#jira UE-147798
#rb David.Harvey
#preflight 62617c186971732e1318d0ec

[CL 19851010 by ben hoffman in ue5-main branch]
2022-04-21 12:25:34 -04:00
robert seiver
ceb65d0775 Removed an unused bool related to Gamepads
#jira none
#rb Brandon.Schaefer
#preflight none

[CL 19786956 by robert seiver in ue5-main branch]
2022-04-18 12:17:31 -04:00
robert seiver
c68adb3c60 Added support for IsGamepadAttached on Linux
#jira UE-33266
#rb Brandon.Schaefer
#fyi @Brandon.Schaefer
#preflight 625d8814d4124345879dcf9f

[CL 19786909 by robert seiver in ue5-main branch]
2022-04-18 12:12:28 -04:00