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

how to make altsnap only work when only the modifier key is pressed #324

Closed
ctf0 opened this issue Nov 15, 2022 · 21 comments · Fixed by #328
Closed

how to make altsnap only work when only the modifier key is pressed #324

ctf0 opened this issue Nov 15, 2022 · 21 comments · Fixed by #328
Labels
enhancement New feature or request

Comments

@ctf0
Copy link

ctf0 commented Nov 15, 2022

for example currently am using Alt to move the window, however this will take over even when using alt + ctrl

Untitled

so how can i limit the window moving to only when alt alone is pressed and nothing else with it.

@Ichisich
Copy link

Set ctrl as the Modifier key for alternate actions.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

this doesnt solve the issue, u basically switched alt with ctrl, but the issue of firing with key combination still exists.

@Ichisich
Copy link

Read again.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

oh ok, got it, but am not sure if its a bug or not

  • if u pressed alt then ctrl we still have the same issue as b4
  • if u pressed ctrl then alt the moving wont happen which is what am after

@Ichisich
Copy link

Not a bug, rather a workaround.

* if u pressed `alt`  then `ctrl` we still have the same issue as b4

I don't know what you mean.

* if u pressed `ctrl` then `alt` the moving wont happen which is what am after

To enable the combination alt+ctrl to move without click, set action without click (alt) to move window instead.
Given your hotkey is alt and your modkey is ctrl.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

Not a bug, rather a workaround.

is there a way to configure this in the ini file of alt snap so it only works when the alt key alone is pressed ?

I don't know what you mean.

here is how to repro

1- set ur config of moving the window like the image above
2- now try to first press alt then ctrl key and move ur mouse "the window will move"
3- next try to first press ctrl then alt key and move ur mouse "nothing will happen"

i believe what happens is that altsnap will listen to the first key down event, and if its configured as a modifier for the action u want to take, it will go with it without waiting to check if there is another key was pressed along or not.

@Ichisich
Copy link

Ichisich commented Nov 15, 2022

i believe what happens is that altsnap will listen to the first key down event, and if its configured as a modifier for the action u want to take, it will go with it without waiting to check if there is another key was pressed along or not.

To get it right:
Your issue is that in your workflow you click alt and then after some time, while alt is still pressed, ctrl down can follow.
And this still triggers the move window action without your intention.
The solution you want is that ctrl should cancel alt down?

Or more abstract, the modkey should cancel the hotkey.
The problem is that the modkey has to take the hotkey into consideration, or alternate actions wouldn't be possible.

My other workaround would be to set ctrl as the kill key.

In the altsnap.ini:
Killkeys=A2 A3

A2=Ctrl left
A3=Ctrl right

@RamonUnch
Copy link
Owner

If you want AltSnap not to hook when an other key is pressed you can add it to the KillKeys list:
By default you have all A-Z virtual keys. In your case you want to use

In the [Input] section of the .ini file
Killkeys=09 2E A2 A3

09 : TAB
2E: ESC
A2 A3 Left and right Ctrl.

In this case you will have:
Ctrl+Alt+Click => Drag
Alt+Ctrl+Click => Normal click without altsnap interaction
Alt+Click => Drag

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

@Ichisich

The solution you want is that ctrl should cancel alt down?

yes

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

@RamonUnch

Ctrl+Alt+Click => Drag

cant this also be Normal click without altsnap interaction ?

@Ichisich
Copy link

Ichisich commented Nov 15, 2022

In case Ctrl is set as killkey and modkey any sequence leads to disabling the action without click.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

In case Ctrl is set as killkey and modkey

focken legend, thank you both so much ❤️

@ctf0 ctf0 closed this as completed Nov 15, 2022
@RamonUnch
Copy link
Owner

Ctrl+Alt+Click is different than Alt+Ctrl+click
There could be an additional option for that for now it is not possible.
An other way to have your Alt+Clicks behave properly is:

  1. any combo of Alt/ctrl/Win+Long click will forward the event.
  2. You can enable the Avoid blocking Alt+click option in the general tab.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

You can enable the Avoid blocking Alt+click option in the general tab

already set

unfortunately the only way to get this to work properly, is to have both configuration in place

  1. how to make altsnap only work when only the modifier key is pressed #324 (comment)
  2. how to make altsnap only work when only the modifier key is pressed #324 (comment)

@RamonUnch
Copy link
Owner

I did not realize you were using the action without click option.

@RamonUnch RamonUnch reopened this Nov 15, 2022
@RamonUnch
Copy link
Owner

I will investigate if a simple mod to improve upon that. For now AltSnap is still usable because Alt+ctrl can be used.

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

yeah np, thanks again for ur quick response & support.

@RamonUnch
Copy link
Owner

@ctf0
I added a simple option to put a limit to the number of pressed key for activation.
In your case you want to use 1 in addition to your modified killkeys list.

in the [Advanced] section of the .ini file.

MaxKeysNum=0
; Maximum number of keys that can be pressed on the keyboard
; at the same time beyond which AltSnap click will no longer activate.
; It will not interupt AltSnap if it is already in the middle of an action.
; Default is 0 (unlimited).

AltSnap1.58test1_x64.zip
AltSnap1.58test1_i386.zip

@RamonUnch RamonUnch added the enhancement New feature or request label Nov 24, 2022
@ctf0
Copy link
Author

ctf0 commented Nov 24, 2022

@RamonUnch thanks alot for the update, however isnt it possible to just use this option without anything else ? this way the user only needs to toggle this from0 > 1 to get the expected behavior.

@RamonUnch
Copy link
Owner

You can use the option without anything else indeed but as soon as the action started you can press the other keys and it will not interupt the movement. This is the role of killkeys.

So in your case as you use the Action without click, the action starts automatically and so if you want both Ctrl+Alt and Alt+Cltr to be unhanded by AltSnap, you need to set ctrl to the killkeys because as soon as you press Alt movement starts. So any other keys than killkeys are ignored or used for modifier.

Short answer is that it is far more simple to have this two separated options and in the case were you are not using Action without click it is very desirable that those options stay separated.

@ctf0
Copy link
Author

ctf0 commented Nov 24, 2022

ok all good then, many thanks again for ur support & hard work ❤️.

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

Successfully merging a pull request may close this issue.

3 participants