[PoC] Orientation Sensor as input device#228
Draft
vicocz wants to merge 4 commits into
Draft
Conversation
added 4 commits
January 1, 2026 01:10
There was a problem hiding this comment.
Pull request overview
Adds a proof-of-concept orientation sensor integration so the device’s orientation can be treated as an input device, with a Settings toggle to enable/disable it via persisted preferences.
Changes:
- Introduces
OrientationSensorController+InputSensorServiceto publish Pitch/Roll/Yaw as axis events via the existing input-device manager. - Exposes sensor support/enabled state on
SettingsPageViewModeland adds corresponding UI toSettingsPage.xaml. - Extends DI/input-device plumbing with a generic
IInputDeviceService<TInputDevice>and a DI registration helper overload.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| BrickController2/BrickController2/UI/ViewModels/SettingsPageViewModel.cs | Injects sensor input-device service and exposes IsOrientationSensorSupported/Enabled for bindings. |
| BrickController2/BrickController2/UI/Pages/SettingsPage.xaml | Adds a Settings row (label + switch) for the orientation sensor. |
| BrickController2/BrickController2/Resources/TranslationResources.resx | Adds OrientationSensor translation key. |
| BrickController2/BrickController2/PlatformServices/InputDeviceService/InputDeviceServiceBase.cs | Adds convenience overload to remove the first matching input device. |
| BrickController2/BrickController2/PlatformServices/InputDeviceService/IInputDeviceService.cs | Adds generic IInputDeviceService<TInputDevice> with IsSupported/IsEnabled. |
| BrickController2/BrickController2/InputDeviceManagement/Sensors/OrientationSensorController.cs | New controller converting quaternion readings to Pitch/Roll/Yaw axis events. |
| BrickController2/BrickController2/InputDeviceManagement/Sensors/InputSensorService.cs | New service that conditionally registers the orientation sensor controller based on prefs/support. |
| BrickController2/BrickController2/InputDeviceManagement/DI/InputDeviceManagementModule.cs | Registers the new sensor input-device service in Autofac. |
| BrickController2/BrickController2/Extensions/ContainerBuilderExtensions.cs | Adds DI helper overload to register typed input-device services. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| using BrickController2.UI.Services.Dialog; | ||
| using BrickController2.UI.Services.Localization; | ||
| using BrickController2.UI.Services.Navigation; | ||
| using BrickController2.UI.Services.Preferences; |
| where TInputDeviceService : IInputDeviceService<TInputDevice>, IStartable | ||
| where TInputDevice : class, IInputDevice | ||
| { | ||
| var registrationBuilder = RegisterInputDeviceService<TInputDeviceService>(builder) |
Comment on lines
+51
to
+57
| private void RaiseEvents((string eventName, float value)[] axisEvents) | ||
| { | ||
| var events = axisEvents | ||
| .Where(e => HasValueChanged(e.eventName, e.value)) | ||
| .ToDictionary(e => (InputDeviceEventType.Axis, e.eventName), e => e.value); | ||
|
|
||
| RaiseEvent(events); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.