Search found 77 matches

by Coiler
25 Feb 2021, 18:07
Forum: AutoHotkey v2 Help
Topic: Window Active or Focus Event?
Replies: 1
Views: 69

Window Active or Focus Event?

I'm currently using a complex hot-if callback function for all of my hotkeys, and one of the first condition tests in that callback is the focused application. I was concerned that as I extend this key map, I may eventually have 10+ actions binded to any given key, where each app has its own actions...
by Coiler
25 Feb 2021, 08:34
Forum: Wish List
Topic: Optimized access to string characters
Replies: 9
Views: 372

Optimized access to string characters

There is currently no efficient method to test strings for a prefix, suffix, or random-index character. As far as I can tell, we only have the ability to use SubStr to extract a new string containing the specific character, then compare it to our target. It would be great to have the ability to simp...
by Coiler
17 Feb 2021, 11:50
Forum: Ask For Help
Topic: Space Mouse
Replies: 1
Views: 48

Space Mouse

Is anyone familiar with the Space Mouse by "3D Connexion"? ( https://3dconnexion.com/us/ ) First, the point. I want to simulate whatever commands the Space Mouse is sending, which apps (like Z-Brush) respond to, with AHK. First, I'm wondering what type of events the Space Mouse broadcasts? And secon...
by Coiler
13 Feb 2021, 12:08
Forum: Ask For Help
Topic: Determine casing with numbers and/or symbols
Replies: 4
Views: 66

Determine casing with numbers and/or symbols

Is it possible to determine casing (capitalization) modes in a string that includes numbers or symbols? Essentially, I want to be able to test strings for "all-caps", and test for "all-lower-case", in strings that may include numbers and/or symbols. Is this possible? I'm mostly interested in simple ...
by Coiler
04 Feb 2021, 12:00
Forum: Ask For Help
Topic: Detect hotkey device?
Replies: 1
Views: 103

Detect hotkey device?

Is it possible to determine which device a hotkey belongs to by name? Or in other words, if I have the name of a hotkey, is there a command/function I can call to determine if that hotkey belongs to the keyboard, mouse, or joystick? I guess we could use substring tests if all else fails: joystick = ...
by Coiler
03 Feb 2021, 20:50
Forum: Ask For Help
Topic: Key falling through my script?
Replies: 1
Views: 382

Re: Key falling through my script?

I think I may know what was causing the problem. If you look closely at the history, you can see I am simulating the Ctrl key, and it happens to be down during the A press that "falls through". I'm not really sure why this is happening, though, because I didn't think AutoHotKey normally responds to ...
by Coiler
03 Feb 2021, 19:13
Forum: Ask For Help
Topic: Automated word replacement list
Replies: 2
Views: 559

Re: Automated word replacement list

So a portable regular expressions setup? That's pretty cool! I have regular expressions in my IDE, but its pretty sweet to make it portable like that. Personally, I was hoping for something a little more automated. Something along the lines of "click here, click there, press this button, abracadabra...
by Coiler
03 Feb 2021, 18:52
Forum: Ask For Help
Topic: Key falling through my script?
Replies: 1
Views: 382

Key falling through my script?

Is anyone able to understand why my 'A' key press is randomly falling through my script? I don't get a "hot-test" condition check for this press at all. It appears to be completely ignored by AutoHotKey. Yet it shows up in the key history: Unseen.jpg Is anyone able to see any reason it would? Or per...
by Coiler
03 Feb 2021, 13:15
Forum: Ask For Help
Topic: Automated word replacement list
Replies: 2
Views: 559

Automated word replacement list

This is a situation I've found myself in while programming, countless times, in multiple languages. You have a "target list" and a "source list". And you need to "reformat" your source list into your target list. The source list already exists (somewhere), and the target list usually exists only in ...
by Coiler
02 Feb 2021, 06:11
Forum: Ask For Help
Topic: Clear string after VarSetCapacity? Topic is solved
Replies: 4
Views: 129

Re: Clear string after VarSetCapacity? Topic is solved

I had a feeling it had something to do with StrPut() , but I was using the function incorrectly when I tested it. Thanks a ton! EDIT: It took some rifling to figure out how to do this same thing in AHK V2, but I believe I may have figured it out. If anyone believes this is incorrect, please let me k...
by Coiler
02 Feb 2021, 05:47
Forum: Ask For Help
Topic: Clear string after VarSetCapacity? Topic is solved
Replies: 4
Views: 129

Clear string after VarSetCapacity? Topic is solved

Is there any way to clear a string's contents after using VarSetCapacity() on it, without losing its larger memory buffer? I just want to insert a terminating character into position 0 and/or set its length to 0. Just to make sure I'm being clear, I can't use string := "" , because this will destroy...
by Coiler
01 Feb 2021, 07:58
Forum: AutoHotkey v2 Help
Topic: Avoid conditional branching on hotkey?
Replies: 1
Views: 362

Avoid conditional branching on hotkey?

I'm still working on this Tartarus script for artists to use with graphics programs like Z-Brush, Photoshop, and Substance Painter. One of the issues I've encountered is providing functionality that is triggered when the left mouse button (or pen) is pressed. I'm trying to avoid attaching a bunch of...
by Coiler
28 Jan 2021, 09:35
Forum: Ask For Help
Topic: Conditional Functions
Replies: 3
Views: 585

Conditional Functions

This was a difficult one to search for. I'm wanting to define a set of functions that only do something when a certain (single) value is set to true. And the value will not change once the script is running. My preference is to impact performance as little as possible in either case (true or false)....
by Coiler
17 Jan 2021, 17:38
Forum: Ask For Help
Topic: Variable hiding under a rock Topic is solved
Replies: 4
Views: 114

Re: Variable hiding under a rock Topic is solved

Okay, thanks for the info. I had no trouble with it. You can call a function within a function. Didn't it work when you tested it? Yeah, I did. And it worked. But I can't count the number of times I've been burned by trusting my own tests instead of learning to do something correctly. And this is a ...
by Coiler
17 Jan 2021, 17:22
Forum: AutoHotkey v2 Help
Topic: Reference to Map element?
Replies: 3
Views: 157

Re: Reference to Map element?

You're saying referencing a map key lookup some how references the lookup itself, rather than the object that exists in the hash table? Why on earth would it work that way? If that's the case, then define a linear array of data/objects, and store their indices in the map. Once an object is located b...
by Coiler
13 Jan 2021, 09:44
Forum: Ask For Help
Topic: Variable hiding under a rock Topic is solved
Replies: 4
Views: 114

Variable hiding under a rock Topic is solved

Is this kind of thing ok in AHK? And if so, does anyone know how this works, logically? Do variable references not get destroyed on scope exit? Or is it that conditions do not count as scopes? Function() { if( rock ) my_var := my_value do_some_stuff() if( rock ) break_rock( my_var ) } Thanks! Edit: ...
by Coiler
01 Jan 2021, 15:48
Forum: AutoHotkey v2 Help
Topic: String != String case insensitive?
Replies: 9
Views: 200

Re: String != String case insensitive?

Looks like I'm being baited with that question. You threw a big juicy piece of steak on the ground and now you're hiding behind the building with a baseball bat. If you don't already know why its not intuitive, my perspective on it won't help convince you, but I guess I'll try anyway. Any specific l...
by Coiler
01 Jan 2021, 15:17
Forum: AutoHotkey v2 Help
Topic: How long does critical last?
Replies: 8
Views: 211

Re: How long does critical last?

What is interrupting your thread if not hotkey? In case of timer, you can use Thread "NoTimers", 1 , see https://lexikos.github.io/v2/docs/commands/Thread.htm It is just hotkeys. Basically, my script sets states when certain keys are pressed, and those states change the behavior of other keys until...
by Coiler
01 Jan 2021, 11:43
Forum: AutoHotkey v2 Help
Topic: How long does critical last?
Replies: 8
Views: 211

Re: How long does critical last?

I ended up having to use a very large critical time to get the behavior I wanted. But if you do this and use KeyWait , make sure to turn critical off before waiting on the key. I assumed KeyWait would automatically turn critical off, but it does not. Without manually turning it off, I receive a ton ...
by Coiler
01 Jan 2021, 10:26
Forum: AutoHotkey v2 Help
Topic: Multiple Hotkeys with Same Source Key
Replies: 2
Views: 146

Re: Multiple Hotkeys with Same Source Key

What I ended up doing was using a ThreadMap := map() , where each map-key is the hotkey name, and the map keeps track of the number of "active threads" for each hotkey. Essentially, only the very first key/thread to activate executes its logic. All of the others just use KeyWait() , then exit. This ...

Go to advanced search