Search found 41 matches

by WalterRoberts
13 Aug 2020, 21:00
Forum: Ask For Help
Topic: Combining #If-Conditions in New Variables? Topic is solved
Replies: 6
Views: 1349

Re: Combining #If-Conditions in New Variables? Topic is solved

In what sense does that “work”? It would always evaluate as true because a string of text resolves as true, not because the key state is actually being evaluated. Yes, you are absolutely right, as it turns out I apparently only did very light testing. Don't get me wrong, in my main script I am curr...
by WalterRoberts
13 Aug 2020, 19:22
Forum: Ask For Help
Topic: Combining #If-Conditions in New Variables? Topic is solved
Replies: 6
Views: 1349

Re: Combining #If-Conditions in New Variables? Topic is solved

Using a function probably is the way to go. I know that using := I have assigned purely text to those variables. I did a little experimenting before posting, and could not get it to work at all using the := operator. I thought that maybe there is a way to simply make the variable a literal placehold...
by WalterRoberts
13 Aug 2020, 18:39
Forum: Ask For Help
Topic: Combining #If-Conditions in New Variables? Topic is solved
Replies: 6
Views: 1349

Combining #If-Conditions in New Variables? Topic is solved

Some of my #If conditions have gotten rather complicated to read. I am thinking of simplifying them, purely for better visualization. The following are just basic examples which currently don't work. Is this somehow possible to achieve? space_pressed = GetKeyState("Space", "p") notepad_active = WinA...
by WalterRoberts
28 Jul 2020, 17:17
Forum: Bug Reports
Topic: Issue with "prefix & key UP" Topic is solved
Replies: 6
Views: 3577

Re: Issue with "prefix & key UP" Topic is solved

You are actually right - the bug no longer exists! Usually I am very thorough with my investigations before posting... For some unexplainable reason I must have still been using the old version after all and a restart probably fixed everything. Thank you for your efforts in still actively maintainin...
by WalterRoberts
27 Jul 2020, 22:14
Forum: Bug Reports
Topic: Issue with "prefix & key UP" Topic is solved
Replies: 6
Views: 3577

Re: Issue with "prefix & key UP" Topic is solved

For some reason I am still able to reproduce this bug in v1.1.33.02 found in the code at the very top of this post. This is not a big deal since by now I know of the simple workaround by explicitly defining the key down event [ s & a::return in this example]. Thought I'd just let you know my observa...
by WalterRoberts
26 Jul 2020, 22:03
Forum: Ask For Help
Topic: Reroute all keypresses from focused window to another
Replies: 0
Views: 607

Reroute all keypresses from focused window to another

When watching videos in Picture-in-Picture mode (Firefox) the key commands will no longer be transmitted to the parent window. This is unfortunate as it makes keyboard shortcuts like forward/backward and also my video speed control commands impossible to use. I know there is ControlSend and I could ...
by WalterRoberts
24 Jul 2020, 17:49
Forum: Ask For Help
Topic: Using A_ThisHotkey Within Functions Topic is solved
Replies: 9
Views: 1110

Re: Using A_ThisHotkey Within Functions Topic is solved

I have done a bit more experimenting and have come to the conclusion that for some reason the asterisk inside GetKeyState(*ThisHotkey,"P") causes all the above mentioned trouble. After a bit more research I have found the missing link: ThisHotkey := SubStr(A_ThisHotkey, 0) This is only going to retu...
by WalterRoberts
24 Jul 2020, 16:32
Forum: Ask For Help
Topic: Artificially Simulating Keyboard-Text-Selection
Replies: 0
Views: 289

Artificially Simulating Keyboard-Text-Selection

I am trying to simulate keyboard text selection, or more general speaking a keystroke with at least one modifier being held down at the same time. The obvious way would be simply writing q::+Left . Unfortunately, my Digital Audio Workstation recognizes these commands as being separate. Changing the ...
by WalterRoberts
24 Jul 2020, 15:52
Forum: Ask For Help
Topic: Using A_ThisHotkey Within Functions Topic is solved
Replies: 9
Views: 1110

Re: Using A_ThisHotkey Within Functions Topic is solved

Just out of curiosity, why do you prefer functions over standard labels for this?? :think: Possibly I am missing another valid way of optimizing this process in AHK, but with a function I could easily exchange the duration of Sleep by simply editing the global function. Also, it makes the script ve...
by WalterRoberts
24 Jul 2020, 04:14
Forum: Ask For Help
Topic: Using A_ThisHotkey Within Functions Topic is solved
Replies: 9
Views: 1110

Re: Using A_ThisHotkey Within Functions Topic is solved

Yes, this is working, thank you! I have noticed that in this case defining A_ThisHotkey as a separate variable is actually optional. Now to the second part of my problem: Optional Parameters. For many key commands I need to simulate modifiers like so: *a:: Send {Ctrl Down} Send {Alt Down} Send {Left...
by WalterRoberts
24 Jul 2020, 03:42
Forum: Ask For Help
Topic: Using A_ThisHotkey Within Functions Topic is solved
Replies: 9
Views: 1110

Re: Using A_ThisHotkey Within Functions Topic is solved

This still does not work and results in an infinite loop... By the way, I am not using this for gaming, but actually for optimizing key commands in my Digital Audio Workstation in order to be more efficient.
by WalterRoberts
24 Jul 2020, 02:59
Forum: Ask For Help
Topic: Using A_ThisHotkey Within Functions Topic is solved
Replies: 9
Views: 1110

Using A_ThisHotkey Within Functions Topic is solved

SimulateKeystroke(Key_Value) { Send {%Key_Value%} Sleep 200 Loop { GetKeyState, state, %A_ThisHotkey%, P If state = U Break Sleep 30 Send {%Key_Value%} } } This does not work and instead terminates in an infinite loop. The error must lie within A_ThisHotkey because when substituting this with the a...
by WalterRoberts
08 Jul 2020, 21:49
Forum: Bug Reports
Topic: Issue with "prefix & key UP" Topic is solved
Replies: 6
Views: 3577

Issue with "prefix & key UP" Topic is solved

#IfWinActive ahk_class Notepad a::Send b #IfWinActive s & a UP::MsgBox An undesired 'a' is printed. d & a::MsgBox This apparently only happens in combination with *key* UP hotkeys. Maybe I am missing something, but I believe this is a bug. It happens both in Notepad as well as in any other active p...
by WalterRoberts
08 Jul 2020, 11:16
Forum: Ask For Help
Topic: Activate Window Under Mouse Only If Pointer Is Not Moving Topic is solved
Replies: 2
Views: 569

Activate Window Under Mouse Only If Pointer Is Not Moving Topic is solved

#WinActivateForce #MaxThreadsPerHotkey 2 <#Space:: tracking := !tracking Loop { If (tracking) { MouseGetPos,,, hwnd WinActivate, ahk_id %hwnd% Sleep, 200 } Else { Break } } Return Sometimes I need the window under the pointer to be activated to receive key commands. The code above works great as a ...
by WalterRoberts
04 Jul 2020, 14:25
Forum: Ask For Help
Topic: Problem With "If WinExist" in Function Topic is solved
Replies: 3
Views: 1076

Re: Problem With "If WinExist" in Function Topic is solved

Well, guess I had tried every possible combination except for trying without any preceding signs at all. A simple problem with a simple solution. Thank you!
by WalterRoberts
04 Jul 2020, 13:09
Forum: Ask For Help
Topic: Problem With "If WinExist" in Function Topic is solved
Replies: 3
Views: 1076

Problem With "If WinExist" in Function Topic is solved

Run_or_ActivateProgram(Program_Class, Program_Path) { If !WinExist("%Program_Class%") { Run %Program_Path% } Else { WinActivate %Program_Class% } Return } #f:: Run_or_ActivateProgram("ahk_class MozillaWindowClass", "C:\Program Files\Mozilla Firefox\firefox.exe") Return For some reason If !WinExist(...
by WalterRoberts
21 Jun 2020, 10:36
Forum: Ask For Help
Topic: Active Window Following Win+D / Show Desktop? Topic is solved
Replies: 6
Views: 1805

Re: Active Window Following Win+D / Show Desktop? Topic is solved

Thank you, this is exactly what I was looking for! How did you figure it out? For me Window Spy was to no avail in this case, it kept showing me the previously active window instead...
by WalterRoberts
21 Jun 2020, 09:10
Forum: Ask For Help
Topic: Active Window Following Win+D / Show Desktop? Topic is solved
Replies: 6
Views: 1805

Active Window Following Win+D / Show Desktop? Topic is solved

Does anybody know which window is active after pressing Win + D , or after having moved the mouse to the very right bottom corner and clicking? I thought it should be "ahk_class Progman" , but it turns out it is not... Test it yourself with my code below, if you don't believe me. Unfortunately Windo...
by WalterRoberts
22 May 2020, 15:44
Forum: Ask For Help
Topic: Simplifying Remapped Custom Combinations
Replies: 2
Views: 230

Re: Simplifying Remapped Custom Combinations

GEV You absolutely had the right idea and helped me create an (almost) fully working solution. The specific problem I was having with your code was not any longer being able to use LWin+Space for example to change input language - in other words all combinations with {Modifier}+{Space} would no lon...
by WalterRoberts
19 May 2020, 19:30
Forum: Ask For Help
Topic: Create a LButton from only a Variable Topic is solved
Replies: 6
Views: 310

Re: Create a LButton from only a Variable Topic is solved

I am using a function in combination with AHKHID.ahk which detects in real-time whether a button on my mouse (which is otherwise unassignable) is physically pressed down at the moment or not (G6State is true or false). I think my solution is hard to follow if you don't see the function itself. Anywa...

Go to advanced search