Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Be able to query key state #8

Open
nucleartide opened this issue Sep 13, 2018 · 3 comments
Open

Be able to query key state #8

nucleartide opened this issue Sep 13, 2018 · 3 comments

Comments

@nucleartide
Copy link

Hey Boyd,

First off, I absolutely love Scenic! Thanks so much for taking the time to create it, it is incredible.

I was wondering if you'd be open to supporting "keyboard state queries" in Scenic. It'd be useful for games that need to know the input state immediately. GLFW's key events are not as useful for real-time-y stuff, since they have "press", "repeat", and "release" phases that don't report back immediately.

Here's the part in the GLFW docs that describe the GLFW function we want: http://www.glfw.org/docs/latest/input_guide.html#input_key

What are your thoughts? 🙂

@boydm
Copy link
Collaborator

boydm commented Sep 13, 2018

How "immediate" do you need the response? In order to query glfw, the Elixir side of the driver needs to query the port, which then needs to act on it, and send another message back to the BEAM process.

@nucleartide
Copy link
Author

Hmm, I'd like for it to complete within 1/60 of a second (so a frame). I was thinking of calling it here.

This may be wrong, but it seems like glfwGetKey will be fast, and the communication between Elixir and C is the questionable part. Do you think the Elixir-to-C communication will complete in time?

@boydm
Copy link
Collaborator

boydm commented Sep 14, 2021

At long last, this will be fixed in v0.11
Coming soon

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants