GithubHelp home page GithubHelp logo

Keyboard Up and Down events about fna HOT 2 CLOSED

jeffphilp avatar jeffphilp commented on August 16, 2024
Keyboard Up and Down events

from fna.

Comments (2)

flibitijibibo avatar flibitijibibo commented on August 16, 2024

It would mostly depend of the cost of adding something like OnKeyDownEXT, since that does add some cycles to a critical XNA4 component, whereas something like TextInputEXT was almost entirely separate minus some control keys. This is definitely a common request though so I'll have to think about this again after MAG.

from fna.

flibitijibibo avatar flibitijibibo commented on August 16, 2024

After thinking about this a little more I'm not sure I'd be willing to go for it.

The big reason is that the event loop covers so much more than just keys, and covering events for every single thing that XNA provided (unlike TextInputEXT where they totally ignored it) is just too much for us to maintain. It's a good case of "we're willing to fix XNA's gaps, but we can't make XNA good."

The way I would design it is as a static InputEventsEXT extension, which would provide events for key down/up, mouse button down/up, gamepad button down/up, and so on. And you can see just how much would have to get tracked, in addition to all the other things that each form of input might find valuable (including device add/remove events even).

Dumb as it sounds, it's probably better to just track the events with SDL_AddEventWatch, because that way there aren't a good 2-3 layers acting as interference with what amounts to 2 if statements and lots of glitter that you can check out in the SDL_KeyboardEvent (glitter that FNA would never be able to cleanly provide):

https://wiki.libsdl.org/SDL_KeyboardEvent
https://wiki.libsdl.org/SDL_Keysym
https://wiki.libsdl.org/SDL_Keymod

from fna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.