Code Monkey home page Code Monkey logo

Comments (5)

tparisi avatar tparisi commented on August 11, 2024

Hey Jules - I verified that this is a bug. I found an issue with fixing it, namely that in order to have a good FPS you will need keyboard input. We need a way to make the GLAM canvas take the keyboard input. Internally there is a way to do that via JavaScript by setting it as a "tabstop" but I need to think about how to surface this to the tag set. Maybe just a "tabstop" attribute on the root <glam> tag?

Any thoughts?

from glam.

julescone avatar julescone commented on August 11, 2024

Hi Tony, thanks for getting onto this. So as I understand it the tabstop setting is essentially targeting the canvas inside the glam tag to expect/accept the keyboard input.

I haven't tested whether I can have multiple glam tags (and scenes) in one page, but assuming you can it might make more sense to call the attribute something like keyTarget or inputTarget or something similar rather than expose the tabstop concept at the tag level.

I presume it makes more sense to have that attribute set on the glam tag rather than the scene but that is obviously your call.

Thanks again for looking at this, once we get the fps setting working I would be happy to contribute an example to the GLAM repo for others to refer to.

from glam.

tparisi avatar tparisi commented on August 11, 2024

Good points...

I don't have multiple GLAM canvases working on a single page yet. That's something I need to work on - later.

Would tabstop/keyTarget/whatever automatically give the set focus to the canvas, or would it just make it so that clicking gives it focus?

Do you think this is an appropriate thing to put in the declaration syntax, or would it be better to just provide an API method e.g. glam.focus()?

Tony

from glam.

julescone avatar julescone commented on August 11, 2024

No problem on the multiple canvas scenario, I hadn't actually thought of using that in any case. :)

I guess you could add it as an attribute on the GLAM canvas so that if the attribute is present then it would automatically set the focus to that canvas, and then add an API method as well that could be used to programatically switch on and off the focus.

A default behaviour of setting the focus by clicking in the canvas would probably make sense too, then it would still work even if you didn't set the attribute or make the API call.

Is that useful?

from glam.

tparisi avatar tparisi commented on August 11, 2024

Yes very useful. r/e the default behavior of clicking: that makes sense but I would also want to provide a "notabstop" attribute to override that. Thanks for the input; let me meditate a little and I'll keep in you in the loop as I make the changes.!

from glam.

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.