Search found 9 matches

by formicant
13 Sep 2019, 02:14
Forum: Scripts and Functions (v1)
Topic: [CLASS] Lyt - Keyboard layout (language) operation
Replies: 29
Views: 13507

Re: [CLASS] Lyt - Keyboard layout (language) operation

The GetInputHKL method does not work on x64 because of this line:

Code: Select all

Return HKL & ((1 << 8*A_PtrSize) - 1)
The behaviour of 1 << 64 is undefined. It does not always return 0 as one could expect.


This will work:

Code: Select all

Return A_PtrSize = 4 ? HKL & 0xFFFFFFFF : HKL
by formicant
30 Jan 2018, 13:03
Forum: Scripts and Functions (v1)
Topic: [CLASS] Lyt - Keyboard layout (language) operation
Replies: 29
Views: 13507

Re: [CLASS] Lyt - Keyboard layout (language) operation

Great! Thanks.
(Please note that the method names in the examples differ from the ones in the class. E.g. GetLng ~ GetLocaleName.)

BTW, what is the best way to monitor the layout changing?
by formicant
26 Jan 2018, 10:11
Forum: AutoHotkey Development
Topic: ||= and &&= operators
Replies: 6
Views: 2734

Re: ||= and &&= operators

a := a && b Reads well when the first argument is short. But, for example, in the actual code I’m writing, I had to write: this.Layouts[layout.Level] := this.Layouts[layout.Level] || { } and this.Combinations[combinator][length] := this.Combinations[combinator][length] || new Dictionary Isn’t the p...
by formicant
25 Jan 2018, 09:45
Forum: AutoHotkey Development
Topic: ||= and &&= operators
Replies: 6
Views: 2734

Re: ||= and &&= operators

What would &&= do? :think: Obviously,  a &&= b  should be equivalent to  a := a && b . E.g. totalSuccess := true for index, item in items { itemSuccess := Process(item) totalSuccess &&= itemSuccess } MsgBox(totalSuccess ? "All items processed successfully" : "Some items processed with errors")
by formicant
25 Jan 2018, 04:29
Forum: AutoHotkey Development
Topic: ||= and &&= operators
Replies: 6
Views: 2734

Re: ||= and &&= operators

(…or should I post this to the Wish List section?)
by formicant
24 Jan 2018, 13:15
Forum: AutoHotkey Development
Topic: ||= and &&= operators
Replies: 6
Views: 2734

||= and &&= operators

A use case: We don’t know if the object exists and want to initialize it if not. In 1.1, we have to write: if(not objectWhoseExistenceIsQuestionable) objectWhoseExistenceIsQuestionable := initialValue In 2.0a, we can also write: objectWhoseExistenceIsQuestionable := objectWhoseExistenceIsQuestionabl...
by formicant
22 Jan 2018, 22:40
Forum: AutoHotkey Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 7607

Re: Object declaration syntax Topic is solved

Be aware that there is currently a limit of 512 tokens per expression, where [, ], {, }, "item1", key1, : and , each count as one token. When you create large data structures with a single object literal, it is more likely you will encounter this limit. Yes, I’ve already encountered this, so I move...
by formicant
21 Jan 2018, 23:09
Forum: AutoHotkey Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 7607

Re: Object declaration syntax Topic is solved

GeekDude wrote: For v2 you may have to specify the Quotes option after LTrim Join.
Oh thanks!
I tried continuation sections but haven’t come to the idea of LTrim Join Quotes combination.

Anyway, wouldn’t it be more convenient to make all { } behave like a continuation section?
by formicant
21 Jan 2018, 21:48
Forum: AutoHotkey Development
Topic: Object declaration syntax Topic is solved
Replies: 20
Views: 7607

Object declaration syntax Topic is solved

Currently, both in AHK 1.1 and 2.0-a, one can declare objects like this: singleLineArray := [ "item1", "item2", "item3" ] singleLineObject := { key1: "value1", key2: "value2", key3: "value3" } multiLineArray := [ "item1" , "item2" , "item3" ] multiLineObject := { key1: "value1" , key2: "value2" , ke...

Go to advanced search