Giter Club home page Giter Club logo

Comments (12)

slouken avatar slouken commented on September 13, 2024

What is the output if you set the environment variable SDL_EVENT_LOGGING=1?

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

I disconnected and connected it four times just to check, and the IDs match in both SDL_EVENT_KEYBOARD_ADDED/REMOVED:
regular

With the other keyboard, somehow SDL_EVENT_MOUSE_REMOVED/ADDED is also being sent??? (I connected and disconnected the keyboard once in this case)
mouse

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

Pressing random keys in both keyboards outputs this:
keys

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

The timestamps in the first screenshot are weird, and in the last screenshot, the windowid starts at 2, but it should start at 1, right?

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

creating another window increments the ID counter correctly to 3

from sdl.

slouken avatar slouken commented on September 13, 2024

You can't assume anything about object IDs, other than they'll be non-zero.

from sdl.

slouken avatar slouken commented on September 13, 2024

I clarified the documentation to reduce confusion, thanks for pointing this out!

from sdl.

slouken avatar slouken commented on September 13, 2024

FYI, the keyboard ID for key events will only be set when raw input is enabled on Windows.

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

so key.which is only set on Windows? what about other platforms?

from sdl.

slouken avatar slouken commented on September 13, 2024

so key.which is only set on Windows? what about other platforms?

It depends on the platform. It's not currently defined when it's available, you should experiment and see what works for you.

from sdl.

slouken avatar slouken commented on September 13, 2024

I think SDL_WindowID and SDL_DisplayID should have documentation too, just for consistency.

Done!

from sdl.

lumpalette avatar lumpalette commented on September 13, 2024

so key.which is only set on Windows? what about other platforms?

It depends on the platform. It's not currently defined when it's available, you should experiment and see what works for you.

That's a shame, I saw somewhere that multiple keyboard support was added, but it didn't mentioned it was platform dependant xd. Maybe it should be specified in SDL_KeyboardEvent?

from sdl.

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.