Kaleidoscope
Kaleidoscope copied to clipboard
New plugin idea: numwords/capswords-like thing
I came across an interesting blog post the other day, that described a way to have numbers on the home row. It does so by switching to a layer for inputting numbers, and the layer remains active until only numbers are typed, and it gets turned off if anything else is input.
A plugin that does this, in a slightly generalized way would be awesome. Give it a pair of layer - keycode list, and if it detects that any of the layers is on, and a keycode outside of the list is pressed, it turns the appropriate layer off.
I like this idea! Here's how I would do it:
A plugin that defines a range of special "temp layer lock" keys. Only one "temp layer" is active at any given time, and that layer is tracked. When a temp layer lock key toggles on, if there's an active temp layer, that layer gets deactivated. Then the specified temp layer gets activated, just like a regular layer lock. If there's an active temp layer, then on each key toggle-on event, the plugin checks to see which layer that key is mapped from, and if it's not the current active temp layer, then the current temp layer is deactivated (in addition to the key being processed normally).
In addition, this plugin needs an onLayerChange() handler, so that it if the current active temp layer gets deactivated by any other mechanism, it can record that there is no longer any active temp layer. Otherwise, we could end up deactivating the given layer when the user intended for it to stay active.
It's a fairly simple plugin, I believe, and could be quite useful.