Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default action for keys on layer #705

Open
lobre opened this issue Mar 28, 2024 · 2 comments
Open

Default action for keys on layer #705

lobre opened this issue Mar 28, 2024 · 2 comments

Comments

@lobre
Copy link

lobre commented Mar 28, 2024

I know I can do something like the following to apply a modifier to a full layer by default.

[mylayer:M]

But it would be handy to generalise the concept to all actions, so you could define what the default behavior is for a layer. And if a key does not override this, it gets assigned to the default action.

I think it could reduce the amount of lines in the configuration when you want to redeclare all the keys to do the same action. See an example:

[mylayer]
default = layer(otherlayer)
a = b
b = c

And to go even a bit further, a placeholder current could mean the "current key", to allow things like:

[mylayer]
default = timeout(current, 1000, S-current)
a = b
b = c

Here, all keys on mylayer except a and b would be assigned to the timeout operation defined as default.

What do you think?

@nsbgn
Copy link
Collaborator

nsbgn commented Mar 28, 2024

Cf #651 and in particular #651 (comment)

#681 is also related, and I'd expect that if it makes it in, these two features should be achieved with the same mechanism.

current could mean the "current key"

With the current key meaning whatever it is bound to on the layer underneath, I presume.

@lobre
Copy link
Author

lobre commented Mar 28, 2024

My usecase is hardly reversable as I would like to apply meta-letter on hold for each key of the keyboard pretty much.

a = timeout(a, 1000, M-a)
... 

But thank you for pointing this out.

And yes, I agree, I did not see this issue that you linked but you are right. We are both looking for a way to avoid defining a behavior for "the rest of the keys" on a layer.

To go even a bit further I wanted to even have a way to keep the meta enabled once one of the key has been maintained for 1 second.

So for instance, let's say M-h, M-j, M-k, M-l are used on my desktop environment to focus the windows respectively on the left, down, up or right. If I have the timeout defined for all keys of the keyboard to enable meta, I can do "hold j" to focus window below, and then "hold l" to focus window on the right. But the improvement I had in mind was that this first "hold j" would lock the meta layer, so to then focus the window on the right, I can just hit "l" without holding it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants