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

Is there an ability to combo (chord) non special keys? Also, proper way to eat modifier keys like win and alt? #17

Open
ujl123 opened this issue Dec 20, 2024 · 3 comments

Comments

@ujl123
Copy link

ujl123 commented Dec 20, 2024

How to chord keys?

I'm trying to set up so that q=left click, e=right click and q+e=middle click

I tried setting key-alias.middlebutton=q+e which did not work,

I also tried the below which didn't work.

key-alias.leftbutton=q
key-alias.rightbutton=e
normal-mode.press.middle=+leftbutton+rightbutton
normal-mode.release.middle=-leftbutton-rightbutton

What is the proper way to combo/chord these?

How to eat/supress modifiers?

I'm trying to use leftwin+e, but I'm unsure of how to eat it so that it doesn't trigger the win menu. left alt has the same issues.

Thanks!

@petoncle
Copy link
Owner

petoncle commented Dec 20, 2024

Hello!

I'm trying to set up so that q=left click, e=right click and q+e=middle click

There are several ways to approach this, but the simplest I could think of is:

  • When you press e while q is already pressed, release the left click and trigger a middle click.
  • When you press q while e is already pressed, release the right click and trigger a middle click.

Here are the lines that I changed to the config file to achieve this. I've tried to describe how it works in the comments.

key-alias.exit=p
key-alias.leftbutton=q
key-alias.rightbutton=e
# The alias 'middlebutton' is commented out because we need more 
# complex logic than just a single key. We don't need this alias anymore.
#key-alias.middlebutton=;

# Activate after pressing then releasing the e key. This is to 
# avoid triggering a left click upon activation. There is another way 
# to do this if you're not satisfied with this.
idle-mode.to.normal-mode=_{leftctrl} +e -e

# Press left (if rightbutton is not already pressed).
normal-mode.press.left=^{rightbutton} _{none | leftctrl} +leftbutton | _{none | leftctrl} +clickthendisable
# Press middle if both leftbutton and rightbutton are pressed.
normal-mode.press.middle=_{leftbutton} +rightbutton | _{rightbutton} +leftbutton
# Press right (if leftbutton is not already pressed)
normal-mode.press.right=^{leftbutton} _{none | leftctrl} +rightbutton
normal-mode.release.left=-leftbutton
# Release middle if rightbutton is released (while leftbutton 
# was already released), or if leftbutton is released (while 
# rightbutton was already released).
normal-mode.release.middle=^{leftbutton} -rightbutton | ^{rightbutton} -leftbutton
normal-mode.release.right=-rightbutton

Here is the full config file with this change:
neo-mousekeys.zip

For your second question, I have some work in progress to try to do this: eat the leftwin key when pressed, but if the e key is not pressed after that then cancel the eating of leftwin. Unfortunately, this work is not complete yet. Right now, the only solution -- if you want to use the leftwin key -- is to either always eat the leftwin key (but that's annoying because you can't use the key for anything else), or never eat the leftwin key (but then it will trigger the Windows start menu when you release the key, as you found out).

If you want to eat the leftwin key always, then you can do it with +leftwin:

# +leftwin means press leftwin for a duration of 0 to 250 milliseconds
# +leftwin is the same as +leftwin-0-250
# +leftwin-0 means press leftwin for a duration of at least 0 milliseconds
idle-mode.to.normal-mode=+leftwin-0 +e

@petoncle
Copy link
Owner

petoncle commented Dec 20, 2024

I've got something ready to test for leftwin + e with the ability of cancelling the eating of leftwin if e is not the next key pressed. Would you be willing to test it if I provided a beta build of the app? It may not work and be broken in a way that I haven't seen yet.

@petoncle
Copy link
Owner

Hi @ujl123, in the latest version of mousemaster I made it so you can use the Windows key and it will properly be eaten (only when the activation combo is complete). I've tested it with the original neo-mousekeys.properties file where I changed only 2 lines:

#idle-mode.to.normal-mode=_{leftctrl} +e # This is the original line.
idle-mode.to.normal-mode=+leftwin-0 +e

#normal-mode.to.idle-mode=+exit | -clickthendisable | _{leftctrl} +e # This is the original line.
normal-mode.to.idle-mode=+exit | -clickthendisable | +leftwin-0 +e

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