Comments (10)
- Yeah, many of the QMK keymaps use custom codes for these, when it seems you should be able to use either
MO(layer)
orLT(layer, kc)
for lower/raise, and if you need a tri-state when both held, just a callback that handles that, maybe in a custom callback invoked on layer state changes. - ^ Yes, except maybe the tri-state scenario. We could maybe have other DT entities for defining "linked layers" for things like layer 1 + 2 then triggers layer 3.
- Yeah, that could definitely happen. I suppose one plus would be, it would be easy to do either, and we can see which "wins" based on use.
from zmk.
I've created #29 just now for folks to evaluate. I also pushed a sample repo w/ a bunch of kinds of configs: https://github.com/petejohanson/zmk-config-examples
from zmk.
There's a decent VSCode extension that adds at least code highlighting with ID plorefice.devicetree
and I actually just pushed a VSCode settings.json
to ZMK that at least sets the *.overlay
files to use that syntax.
No completion at this point. Usually, it's a matter of the build borking.
from zmk.
Thinking about this, I really think we start with only the default keymap "in tree" and we quickly tweak the CMake code to allow specifying a keymap dir directly, or use an out of tree full hierarchy of boards/shields/keymaps.
from zmk.
Oh! And we build a GH action to build ZMK for an out of tree keymap! There's a basic build service for free!
from zmk.
Ok, so thinking about this even more, I think we don't even have a "keymaps" (plural) directory anywhere in tree at all.
Proposal:
- Each shield or full keyboard board includes a
keymap
subdirectory. - This directory has a DT overlay file that contains the default layers and keymap.
- The directory has a
keys.h
file with required custom keycodes, if any (raise and lower ones, although eventually I think we can have standard codes that do this) - It contains a
keymap.c
file that has "standard keymap callbacks", for things like tri layer state changes. It is added by default, but user keymaps can override a Kconfig value and skip including it.
1 User keymaps including: - If present, a
keymap.overlay
file added as a DT overlay. Doing so allows overriding just the keycodes for a specific layer, while keeping everything else from base keymap, e g.&raise { keys =<list of keucodes for raise layer>:
*everything else is inherited from the base keymap.
1.boards and shield specific overlays, if found, are added, e.f. ifkyria.overlay
andcorne.overlay
exist, one of those will be included depending on the selected shield. CMakeList.txt
that allows adding custom sources for things like callbacks, units to start timers, enable drivers, etc. These files can have conditional code using the DTC defines so if certain hardware is only present in one shield or board overlay, only then is that code enabled.- Some sort of optional defconfig file and/or .conf file for default or force Kconfig settings for things.
With the above:
- We get the "user" behavior, and "per board keymap" behavior from QMK, but all in one unified place for a specific user.
- Users control their entire keymap stuff, and simultaneously don't need to worry about forking, rebasing, etc.
- We use west to help users automate building for their keyboards. Works great to let people use it and not setup local dev environment, until we have a more flexible build service. Can be from a template, so no need for any West or Zephyr Fu to use it!
- Keymaps don't have to duplicate much, if anything, like the raise/lower stuff, or even the layers, and can tweak only the pieces they want to customize.
Thoughts? Will probably.pit together a branch with this to demo.
from zmk.
Thoughts on some of the parts:
- Definitely things like raise and lower and other special layer keys etc should be standard at least eventually
- Would it be possible to have the layer changing auto generated in a way where we wouldn't need to explicitly write out the callbacks for changing layers? i.e. we feed an array of keymaps that then automatically act as layers numbered by their index?
- This sounds really neat. I think it may be under-utilized because it's another layer of abstraction for someone to think about. Thinking relatively vs. seeing the concrete output in front of you is something to consider.
The other points sound good to me. Making a strong template system will help a lot too!
from zmk.
It sounds great! Although I'm admittedly not understanding all the finer details yet. I think I'd have to fiddle with a prototype to get a proper feel for it.
How much of this can we confidently put in place without an understanding of the inner workings of the known outstanding features?
Whatever approach we settle on, my long-term priorities would be (in no particular order):
- keeping the ZMK repository maintainable and synced across the whole codebase
- not having to ask your everyday user to fork/pull/rebase/commit
- providing (intuitive?) discoverability and maintainability of popular configurations
- facilitating discoverability of other configurations
- keeping related configuration together in a single place (if possible)
- having an easy to grasp 'line' between stuff that can be configured easily (basic), and stuff which requires more understanding (intermediate & advanced)
- keeping the 'bar of entry' low where possible
I realise that some of these priorities probably contradict or compete with each other.
from zmk.
Thank you for your continued hard work @petejohanson!
I do like the simplicity of smaller changes.
A slight aside, what tools are you using to edit the DT files? I'm wondering if there's any code completion support available because I found it a bit of a black box when I was using DT previously. Alternatively, does it provide useful feedback if you screw it up? This stuff might not be such an issue once there's a GUI tool to generate code/overlays, but could be important until then.
from zmk.
I'm going to mark this closed. We've pretty much settled in in keymap process, and it seems to be working well enough
from zmk.
Related Issues (20)
- Soft off on the right side of Corne split keyboard issues HOT 4
- Encoder does not work if only on peripheral side
- Combos with `slow-release` produce error during build HOT 2
- Fully overlapping combos always trigger one with fewer numbers of keys HOT 1
- `hold-trigger-key-positions` does not seem to work with `flavor = "balanced"` HOT 3
- Cannot get nice!view to work after recent update HOT 4
- Combo + &mt => Combo wins HOT 3
- Inconsistent behavior when using &caps_word HOT 4
- Sticky key behaviour ignores `release-after-ms` property HOT 3
- ESP32-S2 Support
- `hold-trigger-on-release` cancels effect of `hold-trigger-key-positions` with `flavor = "tap-unless-interrupted";`
- Problem with mod-morph and volume media keys HOT 5
- [Feature Request] Adjust display status screen for better dongle display
- ZMK Logo & Icon Design Requirements
- Feature request: Hyper, MEH and Copilot HOT 7
- `&kp LPAR` generates [`LSHFT` Press, `(` Press, `LSHFT` Release, `9` Release] keycode sequence HOT 4
- Cannot turn off Bluetooth with config (NRF52840 supermini) HOT 2
- Build failure for out-of-the-box Sofle + NRF52840 HOT 2
- `¯o_release` do not repsect the macros `wait-ms` resulting in lost keystrokes HOT 2
- sticky layer on another layers HOT 3
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 zmk.