Simple binding works but adds unwanted effect otherwise impossible to achieve

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
mikeyww
Posts: 26934
Joined: 09 Sep 2014, 18:38

Re: Simple binding works but adds unwanted effect otherwise impossible to achieve

Post by mikeyww » 30 Jun 2022, 10:04

Would read the sections about WinTitle, expressions, and Functions.

Code: Select all

WinExist("ahk_exe Mp3tag.exe")
Example

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Simple binding works but adds unwanted effect otherwise impossible to achieve

Post by A Keymaker » 30 Jun 2022, 10:10

Aside from these three above glitches, this old one is now gone
Keymaker wrote:
10 Jun 2022, 08:12
[...]
Also I have noticed that when running my code, when I use SHIFT to select some files then I can still add to that selection files one-by-one using the middle button - but I am no longer able to de-select them one-by-one in the same way [which I can do normally when the script is not running]
[...]

However, I still would like to
Keymaker wrote:
10 Jun 2022, 08:12
[...]
also add that second way of selecting of many files [i.e. with SHIFT being held down] but still using the same middle button [that has to works with CTRL]
[...]
In other words:

D]
How to expand this script, or add another to it, that would make in Mp3tag Middle Mouse Button being held down equal to a state of Shift being held down - thus allowing for selecting of an area [and thus allowing for a quick selection of multiple adjacent files]; and then release the Shift when Middle Mouse Button is physically released?

Is this possible, or do I have to choose which behavior I prefer?


E]
And also: would it be possible to add other binding to that Middle Mouse Button when the focus would be in a different area of Mp3tag?

That file-selecting script is meant for the [irremovable] main window which hosts the list of files - and now I would also to add a script that would work only in the [removable] box of Filter feature. How can I do that?

And from where can I obtain syntax names of various elements of Mp3tag [like the main window and that Filter feature] and sub-elements of various other programs? From developers? Or is there some AHK script for that or feature within AutoHotkey like Key history and script info that is able to do that?

User avatar
mikeyww
Posts: 26934
Joined: 09 Sep 2014, 18:38

Re: Simple binding works but adds unwanted effect otherwise impossible to achieve

Post by mikeyww » 30 Jun 2022, 20:22

I cannot write the script for you but can offer a few ideas. My first post in this thread shows how to remap a key. You can remap to a different key if needed. See documentation about remapping keys.

If you run Window Spy, which comes with AHK, it shows names of windows & controls. You can have a hotkey check for the presence of some control, check whether the mouse is over a specific control, or check whether the keyboard is focused on a specific control. Your hotkey routine can then use that information to do what you wish. Another option is MouseGetPos if you are concerned with the actual position rather than a control itself. Would see ControlGetFocus and MouseGetPos for details.

Cheers!

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Simple binding works but adds unwanted effect otherwise impossible to achieve

Post by A Keymaker » 12 Jul 2022, 12:58

Keymaker wrote:
30 Jun 2022, 10:10
[...]
E]
And also: would it be possible to add other binding to that Middle Mouse Button when the focus would be in a different area of Mp3tag?

That file-selecting script is meant for the [irremovable] main window which hosts the list of files - and now I would also to add a script that would work only in the [removable] box of Filter feature. How can I do that?
[...]
mikeyww wrote:
30 Jun 2022, 20:22
[...]
If you run Window Spy, which comes with AHK, it shows names of windows & controls. You can have a hotkey check for the presence of some control, check whether the mouse is over a specific control, or check whether the keyboard is focused on a specific control. Your hotkey routine can then use that information to do what you wish.
[...]
After clicking in that Filter Box of Mp3tag, I got ClassNN: Edit1 for Focused Control and Filte&r: for Visible Text

So I tried this

Code: Select all

#If WinActive("ahk_exe Mp3tag.exe") && ControlClick, Edit1, Mp3tag.exe

MButton::X
    SoundBeep, 1900
    Return
#If
but I get neither a sound or [test] X written in that Filter area [while at the same time this one still works viewtopic.php?f=76&t=105182#p470519 in the main window of Mp3tag, adding files to selection with a beep]

gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: Simple binding works but adds unwanted effect otherwise impossible to achieve

Post by gregster » 12 Jul 2022, 13:09

ControlClick is not a function (but a command) and can't be used in expressions.
What do you expect it to return? (It has no return value that can be checked.)

Post Reply

Return to “Ask for Help (v1)”