Search found 97 matches
- 28 Jan 2021, 19:34
- Forum: AutoHotkey v2 Help
- Topic: VK or SC for INT 1-9 and LANG 1-9
- Replies: 2
- Views: 120
VK or SC for INT 1-9 and LANG 1-9
Has anyone had luck making hotkeys out of INT1 thru INT9 or LANG1 thru LANG9? I'm using an Ergodox-EZ keyboard running QMK firmware. It has the ability to send all of these keys, which I was planning to use on a special layer of the keyboard to trigger one-touch AHK macros. However, when I look at t...
- 23 Nov 2020, 12:34
- Forum: AutoHotkey v2 Help
- Topic: New object model diagram?
- Replies: 4
- Views: 231
New object model diagram?
I keep having issues visualizing the new prototype-based object model, especially how class, class.prototype, object, and object.prototytpe all relate. I know we have this explanation from the documentation: Each class object is based on whatever class it extends, or Object if not specified. The glo...
- 20 Nov 2020, 21:25
- Forum: AutoHotkey v2 Help
- Topic: how to reference class/subclass object inside instance method? Topic is solved
- Replies: 11
- Views: 710
Re: how to reference class/subclass object inside instance method? Topic is solved
swagfag this was very helpful. After reading your response, my more focused question then, is by creating a reference to the class of an instance (inside an instance method), does that prevent instances themselves from being destroyed? Based on your answer, I'm thinking the answer is no for two rea...
- 15 Nov 2020, 20:40
- Forum: AutoHotkey v2 Help
- Topic: how to reference class/subclass object inside instance method? Topic is solved
- Replies: 11
- Views: 710
Re: how to reference class/subclass object inside instance method? Topic is solved
swagfag and Helgef , quick follow-up question... I was reading another thread answer you wrote (related to GUIs) that reminded me how circular references can make objects indestructible without first manually removing the references. As it relates to the question in this thread, I've added a "class...
- 15 Nov 2020, 20:16
- Forum: AutoHotkey v2 Help
- Topic: Making a real Enumerator instance Topic is solved
- Replies: 1
- Views: 101
Making a real Enumerator instance Topic is solved
As I've been extending the array class (as well as map and other classes) with DefineProp/DefineMethod to contain certain utility properties/methods, I've written some that return enumerators. For example, I've done things like this in array: enmr ;reverse enumerator of (key,val) or (val) based on a...
- 30 Oct 2020, 01:34
- Forum: AutoHotkey v2 Help
- Topic: how to reference class/subclass object inside instance method? Topic is solved
- Replies: 11
- Views: 710
Re: how to reference class/subclass object inside instance method? Topic is solved
Great writeup, Helgef . Sorry I missed it before posting this thread. Quick question, extending your logic/examples, would it be bad form or bad performance hit to DefineProp to add a getter property to the Object prototype more generally that basically is just class => %this.__Class% ? Since we hav...
- 25 Oct 2020, 23:15
- Forum: AutoHotkey v2 Help
- Topic: how to reference class/subclass object inside instance method? Topic is solved
- Replies: 11
- Views: 710
Re: how to reference class/subclass object inside instance method? Topic is solved
Worked perfectly. Thanks to both of you for responding!
- 25 Oct 2020, 07:50
- Forum: AutoHotkey v2 Help
- Topic: how to reference class/subclass object inside instance method? Topic is solved
- Replies: 11
- Views: 710
how to reference class/subclass object inside instance method? Topic is solved
I'm writing a class that is intended to be subclassed. Inside that class, I'm writing an instance method. Inside this instance method, I need to refer to a static variable of the class (or more likely, subclass) from which the instance was derived. How do I reference the subclass generically? (Basic...
- 30 Sep 2020, 13:20
- Forum: AutoHotkey v2 Help
- Topic: super-global access from class static __new() Topic is solved
- Replies: 4
- Views: 334
Re: super-global access from class static __new() Topic is solved
Thanks for the quick answer. As usual, your answer worked like a charm! #1: Your example global na in the main body worked to allocate the super-global to be later set by the static __new of class script_init, but I'm confused... Does the global declaration in the main body actually execute before t...
- 30 Sep 2020, 12:53
- Forum: AutoHotkey v2 Help
- Topic: How to check if a variable is a string? Topic is solved
- Replies: 3
- Views: 385
Re: How to check if a variable is a string? Topic is solved
You could also extend the solution above directly to strings. I don't think it's much faster than the type() comparison example, but I do this in my own code because it seems cleaner: string := class.new() string.prototype := ''.base s:='1', n:=1 msgbox s is string ; 1/true msgbox n is string ; 0/fa...
- 30 Sep 2020, 12:33
- Forum: AutoHotkey v2 Help
- Topic: super-global access from class static __new() Topic is solved
- Replies: 4
- Views: 334
super-global access from class static __new() Topic is solved
A very large code base I maintain relies on certain "super-globals" that create "constants", on which nearly every function/method depends either directly or indirectly. For example: global na := '`vna' ;sentry for missing parameter Wherever na is used throughout thousands of functions/methods, none...
- 18 Sep 2020, 08:14
- Forum: Bug Reports
- Topic: [a122] wrong string property call when string is name of func
- Replies: 1
- Views: 479
[a122] wrong string property call when string is name of func
Am I missing something obvious here? Seems like all strings should work the same and call the property defined for String. When the string happens to be the name of the function, it calls the property defined for Func. Is there possibly a bug in the Func("Name") optimization code, or is this the exp...
- 05 Sep 2020, 08:15
- Forum: AutoHotkey v2 Help
- Topic: overriding inherited property with value Topic is solved
- Replies: 2
- Views: 343
overriding inherited property with value Topic is solved
I know one can override a calculated property in a subclass by simply redefining the calculated property. Is there any way to revert back from a calculated to non-calculated property (value property or member access or whatever the correct term is)? I've tried various ways, but I keep getting the "p...
- 23 Aug 2020, 20:36
- Forum: AutoHotkey v2 Help
- Topic: [a122] InputHook issues Topic is solved
- Replies: 6
- Views: 2169
Re: [a122] InputHook issues Topic is solved
Wow! Thanks for the explanation. I do get the point that Critical and InputHook don't seem to work well together for the reasons you outline. By the way, except for this issue with InputHook, I've never had another issue with timers/hotkeys/hotstrings in lots of other contexts in this script (which ...
- 22 Aug 2020, 10:20
- Forum: AutoHotkey v2 Help
- Topic: [a122] InputHook issues Topic is solved
- Replies: 6
- Views: 2169
Re: [a122] InputHook issues Topic is solved
Maybe not quite fixed. I have one more issue. When I put this code back into my main script, it still worked in an unexpected way. I traced it down to an interaction with Critical . Here's the code: ;critical 10 ;UNCOMMENT THIS LINE TO CAUSE EARLY TERMINATION inp(len:=-1, tmo:=2.0, tmi:=1.0) ;input ...
- 15 Aug 2020, 13:35
- Forum: AutoHotkey v2 Help
- Topic: [a122] InputHook issues Topic is solved
- Replies: 6
- Views: 2169
Re: [a122] InputHook issues Topic is solved
Thanks, Lexikos. One * did the trick! Everything works as expected. I pulled this from some older code I hadn't run in a while, and I didn't even think about the fact that surplus parameters are no longer allowed. Must have been pre-a103 that I last ran this. I think the * handling is much better (e...
- 15 Aug 2020, 04:13
- Forum: AutoHotkey v2 Help
- Topic: [a122] InputHook issues Topic is solved
- Replies: 6
- Views: 2169
[a122] InputHook issues Topic is solved
I'm not sure if this is a bug, or my lack of understanding of the docs. Probably the latter... The help file for InputHook.Timeout says that "The timeout period ordinarily starts when Start is called, but will restart if this property is assigned a value while Input is in progress." The following is...
- 14 Aug 2020, 15:14
- Forum: Bug Reports
- Topic: [a119] bug: truthy evaluation of byref empty string Topic is solved
- Replies: 2
- Views: 1616
Re: [a119] bug: truthy evaluation of byref empty string Topic is solved
As of a121, this is fixed! Thank you.
For some reason, I'm unable to mark this topic solved. The button is missing...
For some reason, I'm unable to mark this topic solved. The button is missing...
- 08 Aug 2020, 07:44
- Forum: Bug Reports
- Topic: [a119] bug: truthy evaluation of byref empty string Topic is solved
- Replies: 2
- Views: 1616
[a119] bug: truthy evaluation of byref empty string Topic is solved
Seems only to be a problem when passing byref:
Possibly related to the closure issues posted in a previous thread, but possibly not.
Code: Select all
x := ''
msgbox (x == '') ':' (!x) ; 1:1
f(x), g(x)
f(byref v) {
msgbox (v == '') ':' (!v) ; BUG: 1:0
}
g(v) {
msgbox (v == '') ':' (!v) ; 1:1
}
- 24 Jun 2020, 04:19
- Forum: Bug Reports
- Topic: [a112] from [a109] conversion issue
- Replies: 7
- Views: 2171
Re: [a112] from [a109] conversion issue
lexikos and swagfag Sorry friends... I pulled my post down (since it was the last) to try to make it shorter , but I didn't realize you were answering at the same time. The original post is below. You are correct, lexikos. It was a test class. =============================== SOLVED. I wasn't trying...