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

This is amazing. (+ how to assign space to access normal-/grid-mode without conflict) #3

Open
nymation opened this issue Apr 13, 2024 · 3 comments

Comments

@nymation
Copy link

Sometimes, by the grace of gods (and some effort searching), you happen upon a truly remarkable github repo with <10 stars, and you start wondering how many other nuggets of gold you have yet to discover. Thanks a bunch!

Anyway, what's the syntax you're using for the config files? Where can I find documentation on it?

I'm trying to set it up so the grid and/or warp activate when I hold Space, and deactivate when I release it again. Seems like "+space" and "-space" works, but not when I define it alone, so I'd like to be able to browse some docs on it.

@petoncle
Copy link
Owner

Thanks for the kind words 😊

Anyway, what's the syntax you're using for the config files? Where can I find documentation on it?

Well, there is no documentation for the syntax of the config file yet 😞. The documentation we have currently only explains the different pre-made configurations on a high level (e.g. this which is the config called neo-mousekeys).

Given the current lack of docs for the syntax, I usually tell people to start off with one of the 4 pre-made config files.

Anyway, I'll try my best to help you achieve what you're trying to do.

I'm trying to set it up so the grid and/or warp activate when I hold Space, and deactivate when I release it again. Seems like "+space" and "-space" works, but not when I define it alone, so I'd like to be able to browse some docs on it.

What you say about +space and -space sounds absolutely right. Could you tell me what you mean by "define it alone"? If you're trying to create a config file from scratch then don't hesitate to include it here and I'll have a look 🙂

@nymation
Copy link
Author

nymation commented Apr 13, 2024

In AHK, I've set it up so Space only sends " " upon release if no keys were pressed in between. This makes it a very convenient modifier-key. Would be cool if I could use it for cursor-movements as well. Not sure (yet) how to integrate the conditional 'only-send-" "-upon-non-interrupted-release'-behaviour with this config file, however.

Anyway, this is the desired behaviour:

  1. Space + a/s/d/f moves the cursor normally.
  2. Space + j/k/l/ø moves in grid-mode.
  3. I don't want to have to go through an intermediary step in order to access grid behaviour (i.e. pressing G after activating normal-mode seems slow.)
  4. I want to be able to swap from grid to normal behaviour dynamically without having to release Space. That is, I might do Space+j+j+k to go top-left via grid, and then do fine-adjustment via …+f (normal-mode) without being locked by grid.

Aand... after some tinkering, I realize this is for some reason entirely feasible within the existing configuration framework, it doesn't even conflict with my AHK scripts. Somehow the below works. (After defining the key-aliases accordingly and resolving conflicts.)

# normal-mode movement
normal-mode.start-move.up=_{space} +up | _{up} -edge | _{up} -jump
normal-mode.start-move.down=_{space} +down | _{down} -edge | _{down} -jump
normal-mode.start-move.left=_{space} +left | _{left} -edge | _{left} -jump
normal-mode.start-move.right=_{space} +right | _{right} -edge | _{right} -jump
normal-mode.stop-move.up=-up | #edge
normal-mode.stop-move.down=-down | #edge
normal-mode.stop-move.left=-left | #edge
normal-mode.stop-move.right=-right | #edge

# normal-mode clicks
# (also work within grid-/idle-mode, since the combos are also used to transition grid/idle→normal)
normal-mode.press.left=_{space} +leftbutton | _{none | leftctrl} +leftbutton | _{none | leftctrl} +clickthendisable
normal-mode.press.middle=_{space} +middlebutton
normal-mode.press.right=_{space} +rightbutton | _{none | leftctrl} +rightbutton

# grid-mode movement
grid-mode.shrink-grid.up=_{space} +gridup
grid-mode.shrink-grid.down=_{space} +griddown
grid-mode.shrink-grid.left=_{space} +gridleft
grid-mode.shrink-grid.right=_{space} +gridright

# movement-keys are doubly-assigned so they automatically handle transitions between idle, normal, and grid-mode, while requiring to hold Space for anything
idle-mode.to.normal-mode=_{space} +up | _{space} +down | _{space} +left | _{space} +right | _{space} +leftbutton | _{space} +rightbutton | _{space} +middlebutton
normal-mode.to.grid-mode=_{space} +gridup | _{space} +griddown | _{space} +gridleft | _{space} +gridright
idle-mode.to.grid-mode=_{space} +gridup | _{space} +griddown | _{space} +gridleft | _{space} +gridright
grid-mode.to.normal-mode=_{space} +up | _{space} +down | _{space} +left | _{space} +right | _{space} +leftbutton | _{space} +rightbutton | _{space} +middlebutton

normal-mode.to.idle-mode=-space | +exit | -clickthendisable
grid-mode.to.idle-mode=-space | +exit | -clickthendisable

Awesome.

@nymation nymation changed the title This is amazing. This is amazing. (+ how to assign space to access normal-/grid-mode without conflict) Apr 13, 2024
@petoncle
Copy link
Owner

petoncle commented Apr 14, 2024

I've set it up so Space only sends " " upon release if no keys were pressed in between. This makes it a very convenient modifier-key.

That's a very cool idea. I've never thought of using the space bar as a modifier key but it makes sense. Great that you were able to make it work. I believe the only thing that currently can't be done by mousemaster alone is delaying the sending of the space character " " upon release (as opposed to sending it as soon as the key is pressed). If I understand correctly, you were able to do that with an AHK script 👍

There is a way to make the following section a bit shorter:

# movement-keys are doubly-assigned so they automatically handle transitions between idle, normal, and grid-mode, while requiring to hold Space for anything
idle-mode.to.normal-mode=_{space} +up | _{space} +down | _{space} +left | _{space} +right | _{space} +leftbutton | _{space} +rightbutton | _{space} +middlebutton
normal-mode.to.grid-mode=_{space} +gridup | _{space} +griddown | _{space} +gridleft | _{space} +gridright
idle-mode.to.grid-mode=_{space} +gridup | _{space} +griddown | _{space} +gridleft | _{space} +gridright
grid-mode.to.normal-mode=_{space} +up | _{space} +down | _{space} +left | _{space} +right | _{space} +leftbutton | _{space} +rightbutton | _{space} +middlebutton

It is equivalent to the following:

key-alias.directionkey=a s d f
key-alias.griddirectionkey=j k l ø
key-alias.buttonkey=k l ; n y (change me)
idle-mode.to.normal-mode=_{space} +directionkey | _{space} +buttonkey
normal-mode.to.grid-mode=_{space} +griddirectionkey
idle-mode.to.grid-mode=_{space} +griddirectionkey
grid-mode.to.normal-mode=_{space} +directionkey | _{space} +buttonkey

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