Coder Social home page Coder Social logo

Comments (4)

jonathanpallant avatar jonathanpallant commented on June 23, 2024

probably because it was the first to be implemented?

exactly right.

In which cases is it appropriate to fall back on the Us104Key (or any other) layout?

I would say, whenever the majority of the keys are handled by the 'parent' variant. It didn't seem to make sense to duplicate the entire match for US and UK, and have to fix bugs in both, so UK started as a special case of US.

Then again, at least De105Key and No105Key duplicate certain KeyCode mappings

Yeah that's not ideal.

Does it make sense to create longer (with more than 2 layouts) layout chains?

Sure. I would prioritise code space over execution type for a piece of code that at most executes a couple of times per second.

Thoughts

Maybe one solution is to produce text-format tables of scan-code-to-Unicode-value and run a pre-build pre-processor that converts all of those tables into an optimally packed tree of match statements.

from pc-keyboard.

SPuntte avatar SPuntte commented on June 23, 2024

Thanks for the swift reply :)

I would say, whenever the majority of the keys are handled by the 'parent' variant. It didn't seem to make sense to duplicate the entire match for US and UK, and have to fix bugs in both, so UK started as a special case of US.

Agreed.

Sure. I would prioritise code space over execution type for a piece of code that at most executes a couple of times per second.

Sorry, I'm not sure if I understood that correctly.. Did you mean that, keyboard code being relatively "cold", you'd prefer smaller binary size over faster execution?

Thoughts

-- pre-build pre-processor --

Yup, sounds intriguing, and something that could be a fruitful exercise in DSL and compiler design. Maybe something like kbd could be considered – though dynamic and maybe a tad complex – a form of "prior art"?

Personally, I currently lack a realistic use for such a system. However, I could see the support for dead keys, commonly used on European layouts, being a natural driver for something like this.

from pc-keyboard.

jonathanpallant avatar jonathanpallant commented on June 23, 2024

Sorry, I'm not sure if I understood that correctly

It was a typo. I meant "execution time". So, yes, you interpreted my spelling mistakes correctly anyway.

from pc-keyboard.

SPuntte avatar SPuntte commented on June 23, 2024

Alright. I think I got what I was after so I'm going to close this. Cheers!

from pc-keyboard.

Related Issues (11)

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.