Comments (4)
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.
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.
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.
Alright. I think I got what I was after so I'm going to close this. Cheers!
from pc-keyboard.
Related Issues (11)
- Add support for more layouts?
- Fix Pause and PrintScreen
- Release latest GitHub version HOT 2
- UK ScanCodeSet 2 errors HOT 1
- Num Lock processing is wrong in Scan Code Set 2 HOT 1
- Process key events should pass through modifiers consistently
- Split up `Keyboard`
- Feature Request: Open up the API to allow access to the internal Modifiers struct from Keyboard HOT 1
- Inconsistent decoding HOT 3
- Consistency with name of crate and usage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pc-keyboard.