Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
f5b5f1c
Start work on documenting the API
Perksey Feb 15, 2025
4888320
Finish documenting API & split out files
Perksey Feb 22, 2025
2585ede
Add InputMarshal and InputContextDeviceList, lay out SDL implementation
Perksey Mar 15, 2025
2080e1b
Start on SdlInputBackend
Perksey Apr 5, 2025
f1880f0
Push latest work on SDL backend
Perksey May 25, 2025
1d16317
Remove types I didn't use in the end
Perksey May 25, 2025
e497dde
begin mucking about input event processing
domportera Jun 22, 2025
f129ae9
refine internal device creation abstractions
domportera Jun 24, 2025
fcf49f6
continued - move name back where it belongs
domportera Jun 24, 2025
33cc20d
cont'd
domportera Jun 29, 2025
e72bf55
comments/clarity + enum helper class
domportera Jul 4, 2025
3e4e168
simplify enum assistant and provide guaranteed sorted enum values
domportera Jul 4, 2025
bce7136
simpler indexing
domportera Jul 4, 2025
8f00a4b
add support for enums with multiple names for the same value
domportera Jul 4, 2025
bf382bc
optimize enum performance for larger enums
domportera Jul 5, 2025
555275b
clarifying comment
domportera Jul 5, 2025
fb889c6
documentation/cleanup enum class
domportera Jul 5, 2025
021a8c9
begin constructing gamepads via the joystick API
domportera Jul 6, 2025
8e7eda4
some experimentation/progress re: axis/button indexing
domportera Aug 9, 2025
e637ba7
joystick/gamepad abstraction progress, expand rumble system
domportera Aug 28, 2025
d0f05aa
cont'd
domportera Aug 29, 2025
7942c92
start attempting to guarantee unique ids
domportera Sep 1, 2025
7e84c15
move backendextensions to its own file, begin keyboard
domportera Sep 6, 2025
8c5f3da
start key conversions
domportera Sep 6, 2025
e20d640
tweak device id abstraction
domportera Sep 6, 2025
4387adb
begin keyboard text handling
domportera Sep 7, 2025
35677b0
improve text retrieval functions
domportera Sep 7, 2025
e0abc15
continue text recorder
domportera Sep 7, 2025
c7159ad
begin integration with sdl native text entry
domportera Sep 12, 2025
436aa72
add span utility
domportera Sep 14, 2025
a35120a
text entry continued
domportera Sep 14, 2025
67df00f
additional modifier utility methods
domportera Sep 14, 2025
dd81078
create world's weakest fallback key -> character converter
domportera Sep 14, 2025
0ba7c09
add joystick interface to gamepad, invoke id refresh
domportera Sep 14, 2025
ec0e48b
increase number of characters supported
domportera Sep 14, 2025
7983462
organization
domportera Sep 14, 2025
e263b9b
constrained usage of special enum-as-indexes functionality via attrib…
domportera Sep 14, 2025
4d77d20
mark method static
domportera Sep 14, 2025
116ec2d
begin pointer logic - mouse
domportera Sep 21, 2025
0503cca
Merge remote-tracking branch 'origin/develop/3.0' into feature/input-3.0
domportera Nov 21, 2025
09fa974
reintegrate Input into solution, upgrade dotnet, make input compileab…
domportera Nov 22, 2025
0eacca1
the s....
domportera Nov 22, 2025
f7e2354
namespace cleanup, begin custom cursor support
domportera Nov 23, 2025
f8f1ab1
Merge remote-tracking branch 'origin/develop/3.0' into feature/input-3.0
domportera Nov 30, 2025
19f7c7c
add method to analyzer
domportera Nov 30, 2025
c509002
cursor api "complete" (untested)
domportera Dec 5, 2025
42e8391
pointer & target work
domportera Dec 5, 2025
a1e793c
organization, pointer type consolidation
domportera Dec 5, 2025
20b50cc
generic target creation and updating
domportera Dec 6, 2025
e4ce82b
more pointer implementation logic
domportera Dec 21, 2025
f5dd29f
begin pen and touch
domportera Dec 28, 2025
a82556d
remove redundant switch cases
domportera Dec 28, 2025
e4deb68
continued handling of pointer device creation
domportera Jan 4, 2026
573240f
cleanup stuff
domportera Jan 9, 2026
4a2cc72
Merge remote-tracking branch 'origin/develop/3.0' into feature/input-3.0
domportera Jan 18, 2026
41290bf
remove unnecessary handle extensions
domportera Jan 18, 2026
de26f77
begin event finalization/dispatch
domportera Jan 23, 2026
6fc626f
correct IInputHandler signature for pointers
domportera Jan 25, 2026
bbc9874
continued
domportera Feb 1, 2026
3701591
continue fleshing out pointer events
domportera Feb 8, 2026
7eaf84b
continue iterating on pointers, continue populating events as they occur
domportera Feb 14, 2026
c04161f
flesh out and streamline gamepad axis updates
domportera Feb 23, 2026
7564d23
key event populatioon
domportera Feb 24, 2026
5279e9d
organize input handlers
domportera Mar 1, 2026
8bf18d1
begin test environment
domportera Mar 1, 2026
4d81309
remove unused Initialize method, fix index out of bounds on cursor in…
domportera Mar 1, 2026
2ed3fd2
implement missing events, improve fallback ID implementation, etc
domportera Mar 20, 2026
6c24e1a
begin precision timing
domportera Mar 22, 2026
564d0b1
continued
domportera Mar 23, 2026
9abcba2
fix mouse scrolling
domportera Mar 29, 2026
09a8deb
lots of stuff
domportera Mar 29, 2026
d7027f7
use stable sort for event ordering
domportera Mar 29, 2026
e4d9055
ensure propagation of device creation events, fix enum-based button i…
domportera Apr 17, 2026
60ba38c
move unsafe value conversions to their own experimental public class
domportera Apr 17, 2026
030a583
add new experimental IDs to NoWarn property of input csproj
domportera Apr 17, 2026
a273d3b
begin correcting joystick/gamepad implementation
domportera May 16, 2026
b270577
gamepad fixes continued
domportera May 23, 2026
c199d9d
complete xbone gamepad implementation
domportera Jun 15, 2026
e6eb8c5
forgot to commit this using statement
domportera Jun 20, 2026
f5baa1f
optimize/correct hot indexing paths, remove unnecessary comment warni…
domportera Jun 25, 2026
c01ddc6
micro-optimization
domportera Jun 25, 2026
57c6fe4
updates for pen devices
domportera Jun 28, 2026
499634c
re-commit previously yeeted method that was used in debug builds
domportera Jun 28, 2026
3655ebe
do some to-dos, cleanup code / todos
domportera Jul 10, 2026
1907a7d
formatting and documentation
domportera Jul 13, 2026
336571d
cleanup, usings reduction, begin gamepad-touchpad input
domportera Jul 18, 2026
8f60d7d
naming clarity with simulated pointer targets
domportera Aug 28, 2026
3621ed6
clean up usage of event pointer
domportera Aug 28, 2026
326c671
correctness, performance, clarity in naming
domportera Aug 29, 2026
5bc141b
remove secondary sorted collection for SDL events
domportera Aug 30, 2026
43ca6f2
use enum discriminator for input event dispatch
domportera Aug 30, 2026
95f91f5
properly dispose of native memory for event queues
domportera Aug 30, 2026
ec2a906
tweaked input event loop for correctness
domportera Aug 30, 2026
eb1a53a
lil code hygeine, remove redundant pre-sort checks
domportera Aug 30, 2026
29ae7cd
replace now-redundant event queue class with NativeMemory<T>
domportera Sep 5, 2026
ea3c5b9
cleanup
domportera Sep 5, 2026
ab910fa
further pointer/target work and organization
domportera Sep 22, 2026
2098777
pointer target point mapping, generic event flow refactor
domportera Sep 22, 2026
5106245
fix some oopsies
domportera Sep 23, 2026
da69dc7
remove unused code, micro-optimizations
domportera Sep 23, 2026
b130d29
fix release compilation, further micro-optimizations & enumerator usa…
domportera Sep 23, 2026
4c87bc3
reduce capacity checks & collections marshall calls
domportera Sep 23, 2026
8524c36
gamepad axis correction & logging
domportera Sep 23, 2026
81bc3a5
flip y-axis so +Y is up
domportera Sep 23, 2026
0a5b2b9
front-load timestamp calculations and perform no sorting on inputs
domportera Sep 23, 2026
c472a02
dispose native memory on exit (oops)
domportera Sep 23, 2026
a79d710
improve mouse/cursor spec compliance
domportera Sep 25, 2026
48d64fe
various fixes:
domportera Sep 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reduce capacity checks & collections marshall calls
  • Loading branch information
domportera committed Sep 23, 2026
commit 4c87bc3766630e5d36a78fc6851a09a5ccd424ee
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ private unsafe ref TargetPoint CreateOrUpdateTargetPoint(IPointerTarget target,
int? pointIndex = null;
int? defaultIndex = null;

for (var i = 0; i < _actualPoints.Count; i++)
var actualPointsSpan = CollectionsMarshal.AsSpan(_actualPoints);
for (var i = 0; i < actualPointsSpan.Length; i++)
{
var candidatePoint = GetPointRef(i);
ref readonly var candidatePoint = ref actualPointsSpan[i];
if (candidatePoint.Target == target && candidatePoint.Id == touchId)
{
pointIndex = i;
Expand All @@ -50,14 +51,16 @@ private unsafe ref TargetPoint CreateOrUpdateTargetPoint(IPointerTarget target,
if (pointIndex == null)
{
pointIndex = defaultIndex ?? _actualPoints.Count;
EnsurePointsListCapacity(pointIndex.Value, _actualPoints);
actualPointsSpan = CollectionsMarshal.AsSpan(_actualPoints);
isNewPoint = true;
}
else
{
isNewPoint = false;
}

ref var point = ref GetPointRef(pointIndex.Value);
ref var point = ref actualPointsSpan[pointIndex.Value];

// note: a null oldPoint means this is a new point
// see PointChangedEvent for more info
Expand Down Expand Up @@ -201,9 +204,10 @@ protected void AddOrUpdatePoint(uint? touchId, IPointerTarget target, in Vector3
// point was actually removed - after that point changed event, we should remove it
// note - a null newPoint means the point was removed
var previous = point;
for (var i = 0; i < _actualPoints.Count; i++)
var actualPoints = CollectionsMarshal.AsSpan(_actualPoints);
for (var i = 0; i < actualPoints.Length; i++)
{
ref var candidatePoint = ref GetPointRef(i);
ref var candidatePoint = ref actualPoints[i];
if (candidatePoint.Id == previous.Id)
{
candidatePoint = default;
Expand Down Expand Up @@ -270,15 +274,13 @@ protected void UpdatePointRay(uint? touchId, IPointerTarget target, float? xTilt
NewPoint: point), sdlTimestamp);
}

private ref TargetPoint GetPointRef(int index)
private static void EnsurePointsListCapacity(int index, List<TargetPoint> actualPoints)
{
_actualPoints.EnsureCapacity(index + 1);
while (index >= _actualPoints.Count)
actualPoints.EnsureCapacity(index + 1);
while (index >= actualPoints.Count)
{
_actualPoints.Add(default);
actualPoints.Add(default);
}

return ref CollectionsMarshal.AsSpan(_actualPoints)[index];
}

public void TargetDestroyed(IPointerTarget target, long timestamp, ulong sdlTimestamp)
Expand Down
Loading