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

Key Combo and 'Non-click' window grabbing #29

Closed
RamonUnch opened this issue Feb 17, 2021 · 9 comments
Closed

Key Combo and 'Non-click' window grabbing #29

RamonUnch opened this issue Feb 17, 2021 · 9 comments
Labels
WIP Work in progress

Comments

@RamonUnch
Copy link
Owner

@MarqueIV @kdougan @DrBones @pixelbase
Here is a version of AltDrag with an additional
KeyCombo option in the [Input] section of AltDrag.ini:

KeyCombo=0
; If set to 1 you will actually need to press two hotkeys
; to enable AltDrag. (any combinaison of two among all hotkeys)
; You need at least TWO hotkeys!
; Does not apply to Hotclicks!

You can use Alt and Win as hotkey and it will be required to press the combinaison of both keys to enable AltDrag.
This is a way to avoid 99.9% of conflicts with other programs.
Of course you can combine with an other instance of AltDrag in order to have different key combo do different actions with the same click.

An other option added on this build is the Non-click grab feature.
This let you move a window without clicking. set the GrabWithAlt=Move for example.

GrabWithAlt=Nothing
; Same than above but if set to something different than Nothing
; It means that the action will be performed when pressing the hotkey
; without needing to click. This is usefull for touchpads
; Try with GrabWithAlt=Resize and set ResizeCenter=2 and CenterFraction=60

This makes more sense combined with KeyCombo because otherwise the key is completly reserved to AltDrag.
Again you can combine with an other instance of AltDrag in order to have different key combo do different actions.
AltDrag.zip

@DrBones
Copy link

DrBones commented Feb 17, 2021

Only tested the build for a couple minutes now but the GrabWithAlt config seems to mostly do the trick for me. I am slightly confused how though, since the Meta Key is ... somewhat blocked by AltDrag :). I use the Win Key (also tried it with Alt) and the normal key combinations still work (which is a good thing), only individual presses do not register. They do register above the Taskbar though.

Did you implement the functionality by sending a click event as well? I have the added benefit that if I double tab the Hotkey I get a fullscreen window :) The only gripe I have is that the right click resize is not working with this combination. If I left click however the "move cursor" disappears and I can do a right click as normal and resize the window.

I am not currently working on a Windows Laptop anymore but my ideal solution would be to have a e.g. a move with one finger on the touchpad and a resize with two. So the current implementation would have gotten me half the way there and for all fairness BTT or many of the other tools on macOS also don't do this.

The other method I currently use is to have a Move hotkey (say Alt) and when I press an additional key (say Shift) the move switches to resize. Even with two instances I cannot get this to work. The move instance is set up to use KeyCombo=1 and GrabWithAlt=Resize with the Hotkeys "A0 A4" but when I press both Hotkeys the two instances fight over the window. I don't know if this could at all be relieved but would it be possible to have a setting similar to KeyCombo that tells AltDrag to work if and only if ONE Hotkey is pressed? I.e. the first instance would release its hold over the window when shift is pressed as well?

It is amazing to see that you picked up the development on the stagnant piece of software, I am excited now everytime I see a new AltDrag release! 😄 Thank you!

@RamonUnch
Copy link
Owner Author

Yes for now it is quite limited. more work needs to be made on this.
Maybe you coule use Win+Alt for move and Win+Ctrl for Resize with two instances. It should work

If your cursor is pointed to a blacklisted window (like the taskbar) then AltDrad soes not activate.

It is a good idea to add a block key list telling AltDrag to disable if one of those is down.

It does not send a click but the same function is called and checks for the time between two press so it gives the same result.

When using this GrabWithAlt option indeed the mouse buttons can no longer be used to perform other actions. I do not see how to avoid that because the action is running as soon as Alt (or a combo) is down so it blocks other inputs. I will see what I can do.

@RamonUnch
Copy link
Owner Author

RamonUnch commented Feb 18, 2021

@DrBones
Ok, I added a ToggleRzMvKey option in the [Input] section of AltDrag.ini that allows you to set a key to that Invert the Move/Resiez Action.
So try with

GrabWithAlt=Move

ToggleRzMvKey=A2
; A2 => Left CTRL
; Default to empty!

When you press Alt, it moves
Then When you press Ctrl+Alt it resizes the window. You can use any other keys.
You can also use GrabWithAlt=Resize and then Alt Will resize and Ctrl+Alt will Move...
You can also use combo and use Win+Alt => Move and Ctrl+Win+Alt => Resize
Those are just examples...
Note: If you use GrabWithAlt then You need to press the toggle key BEFORE Alt (or Alt combo)
hooks.zip

@MarqueIV If you want Ctrl+Alt+Win+LeftClick to move a window and Ctrl+Win+LeftClick to resize it
Set in the [Input] section of AltDrag.ini

LMB=Resize
Hotkeys=B5 A2
; A2 = Left Ctrl and B5 = Left Win
ToggleRzMvKey=A4
; A4 = Left Alt
KeyCombo=1

And if you want Resize to be ONLY from the Lower right then set

ResizeCenter=0
CenterFraction=100

in the [Advanced] section of ini file.

@RamonUnch RamonUnch added the WIP Work in progress label Feb 18, 2021
@RamonUnch
Copy link
Owner Author

RamonUnch commented Feb 18, 2021

I am not currently working on a Windows Laptop anymore but my ideal solution would be to have a e.g. a move with one finger on the touchpad and a resize with two.

Unfortunately this would require multi touch and I have no idea on how to handle that for now.
I think the support was introduced in Win 7 or 8...
I would also need to buy a multi touch-able device. In the long term I will consider it.

@RamonUnch
Copy link
Owner Author

RamonUnch commented Feb 20, 2021

The only gripe I have is that the right click resize is not working with this combination. If I left click however the "move cursor" disappears and I can do a right click as normal and resize the window.

With next release you will be able to do this.
You will also have all the options in the GUI and will not have to worry about the ini file.
Edit: In order to do it you will have to disable the "Toggle maximize state with left-click while moving" option

@RamonUnch
Copy link
Owner Author

have a try with this version.
I will wait a little before releasing it to be sure there are no new bugs.
AltDrag1.38beta_bin.zip

@f0ursqu4r3
Copy link

WIN+LSHIFT to move (without click) works great, if a little laggy with the window border paint. I haven't tested yet, is it possible to set CTRL+LSHIFT to resize (without click)?

@RamonUnch
Copy link
Owner Author

RamonUnch commented Feb 22, 2021

If you set Left Shift Win Left Ctrl as hotkeys (with ini):
Hotkeys=5B A0 A2
Use the Combo mode, and use Left Ctrl for Invert move and resize actions.
KeyCombo=1

You should have
LCtrl+LShift => Resize
Win+LShift or LShift+Win => Move
Note that LShift+Ctrl will also move.
Also Ctrl+Win Will Resize
Win+Ctrl will move
You have to press the invert key before,

I would not advise those combo however because when selecting text with Ctrl+Shift it will interfere, maybe you do not care though, it is not very disturbing.

So a suggestion to have the minimal intrusiveness would be to use LWin and LAlt as hotkeys and to set one of them as the Invert move resize key and then Alt+Win and Win+Alt will do move/resize depending on the order it was pressed.

If you use Windows 8/10 or if you use Aero under Vista/7 then be sure to check that the "Drag Full Window" option is ON in the General config dialog otherwise it will be very laggy because newer windows have buggy GDI drawing. (I was not careful about the content of the ini file and it was setup for my old WinXP.)

@RamonUnch
Copy link
Owner Author

present in release

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

No branches or pull requests

3 participants