Comments (8)
Yeah we use Xbox's button names, and the indices of all standard buttons match up with the ButtonName enum in order to be a conformant implementation of our Input API. An input backend may define more non-standard buttons if they're available, though.
from silk.net.
I can definitely see the appeal of this, but I don't think we can implement it as properties. We'd probably have to do Gamepads[0].Buttons.GetA()
. Is this still desirable?
from silk.net.
It would be great :D I am looking forward to see this in library
from silk.net.
Is there a standard for naming gamepad buttons?
from silk.net.
If you mean an industry-global standard, no. But for Silk.NET, the agreed-upon proposal for Silk.NET's button names are available here: https://github.com/Ultz/Silk.NET/blob/master/documentation/proposals/Proposal%20-%20Input.md#buttonname
from silk.net.
So the same ButtonName
may refer to buttons in different physical locations, depending on the brand of the controller?
And since said enum exists, what about Gamepads[0].Buttons[ButtonName.A]
?
from silk.net.
Ah right. The ButtonName enum is mapped to its GLFW index, so it's mapped to whatever physical button GLFW maps it to :D
The only reason it's Gamepads[0].Buttons[(int) ButtonName.A]
and not Gamepads[0].Buttons[ButtonName.A]
is because the IReadOnlyList<Button>
interface requires an int indexer, and I'm not sure if we want to create our own interfaces for each IReadOnlyList
usage just so we can have these indexers.
When extension everything is added, we will consider adding strong-typed indexes. See also: dotnet/csharplang#192
from silk.net.
Oh, I was assuming Buttons[int]
would be accessing a button by the index it's exposed as through the.. driver, I assume? And Buttons[ButtonName]
would instead change depending on layout. Such that, for example, 0 => ButtonName.A
on XBox-style controllers, but ButtonName.B
on Nintendo or ButtonName.X
on PlayStation controllers. (Though, then there's Triangle and Square, ...)
from silk.net.
Related Issues (20)
- Unhandled exception. Silk.NET.Core.Loader.SymbolLoadingException: Native symbol not found (Symbol: vkCreateDebugUtilsMessengerEXT) HOT 2
- PresentModeKHR is not blittable HOT 1
- Prefer Wayland over X11 if Available HOT 4
- ImGui extension for silk.net doesn't work. HOT 3
- AL.TryGetExtension fails for most extensions HOT 2
- UTF-8 path not supported on Windows HOT 2
- Is iOS still at the experimental stage? HOT 1
- OpenAL ReopenDevices extension doesn't work HOT 4
- TryGetDeviceExtension succeeds when Device is invalid HOT 4
- Incorrect locals assignment in Matrix2X2<T>.GetDeterminant() implementation HOT 2
- Error while importing custom .obj model.
- Add bindings for Tint HOT 6
- Clash in Vulkan "CreateInstance()" Times HOT 1
- High CPU Usage when checking Joysticks and Gamepads HOT 1
- SDL2 Doesn't Respect WindowOptions.Position Member HOT 6
- "Tutorial 2.2 - Camera" don't work on macos HOT 9
- Move Shader class et. al from the Silk.NET.OpenGL namespace HOT 1
- DirectWrite missing some overloading methods HOT 1
- IMouse.MouseMove Vector2 vector parameter is useless HOT 2
- [SPIRV-Cross] Question: missing GetSprivData() and GetSpirvWordCount() ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silk.net.