axiom3d / sharpinputsystem

A cross platform object oriented input system meant to be very robust and compatable with many systems and operating systems. Written in C# on .NET.
https://axiom3d.github.io/sharpinputsystem
Other
4 stars 2 forks source link

.Net Core Support #14

Open emmauss opened 5 years ago

emmauss commented 5 years ago

Is it possible to add .net core support support. I am currently looking for an input library for my project, which is a Net Core project. And it seems that sharpinput does not support NetCore, though it targets Net Standard.

borrillis commented 5 years ago

Since The core libraries are .NetStandard, they support .Net Core. The reason the samples aren't .Net Core is the lack of System.Windows.Forms support in .Net Core, which is coming in .Net Core 3, although that will be for .Net Core on Windows Desktop initially, I am sure it will be ported to Linux/MacOS in the future. How is your project interacting with the user, is it cmd line or graphical?

emmauss commented 5 years ago

Thing is, my project creates an Opentk window and renders to it. we have a working port of Opentk for Net Core, and the renderer works well, just not the input part. That side has a few issues. It works for normal keyboard and mouse, but some gamepads are being detected wrongly. So I want to use a seperate library for game input.

borrillis commented 5 years ago

I would be very interested in seeing the port of OpenTK to .Net Core, For this project and Axiom

Which platforms are you targeting? Windows, MacOS, iOS, Android, X11? SharpInputSystem is ready for Windows, Android, Linux and MacOS (through X11)

emmauss commented 5 years ago

Windows, linux and mac. though mac isn't really supported due to bad Opengl support on it. The opentk port is here, https://github.com/Ryujinx/Opentk . with the project being Ryujinx. The port is pretty 'minimal', is more of a direct port.

borrillis commented 5 years ago

I will add a OpenTK Sample using the OpenTK.NetStandard package for you.

emmauss commented 5 years ago

Thanks.

emmauss commented 5 years ago

the nuget package is this, https://www.nuget.org/packages/OpenTK.NetStandard/

borrillis commented 5 years ago

Yeah, I saw that, that's great!

emmauss commented 5 years ago

I want to ask, how is game pad support, esp for generic game pads. OpenTK tries to simulate XBox style layout, but that is not suitable for a lot of pads.

borrillis commented 5 years ago

I'd have to double check, but I don't think I assume any particular layout, just identify inputs and their current values. So if a pad has two sticks then it is reported as 4 separate axis, and if the pad has 6 buttons and two triggers then it might be reported as 6 buttons and and additional axis for the triggers. Since I have platform specific assemblies, I can tailor how Xbox gamepads report vs generic. I have both available for testing.

emmauss commented 5 years ago

Oh, that's great.

emmauss commented 5 years ago

Any progress on the example?

emmauss commented 5 years ago

I am now able to run the library on net core, with some workarounds using a console application.

borrillis commented 4 years ago

@emmauss, many thanks for the bugs that you have reported, my apologies for taking so long to address the sample issue, I will be getting to that shortly. You are going to be added to the contributors list for your efforts, again, thanks. cc @all-contributors

borrillis commented 4 years ago

@all-contributors Please add @emmauss for contributing bugs

allcontributors[bot] commented 4 years ago

@borrillis

I've put up a pull request to add @emmauss! :tada:

SalmaAssem2020 commented 3 years ago

@borrillis hi borrilis, um trying to use SharpInputSystem to handle keyboard input to be able to run my ,netcore project on linux, can you write any sample for it please.

Thanks, Salma.