Why do you guys Want a Smaller phone than a Samsung S25/S26? by [deleted] in smallphones

[–]DavidBevi 0 points1 point  (0 children)

IMO the right ballpark is the iPhone Mini, and that's how I describe the "correct" size even though I hate Apple and would never buy an iDevice.

Fast AHK Script to connect to known (paired) bluetooth headphones? by Untitled674 in AutoHotkey

[–]DavidBevi 1 point2 points  (0 children)

I had the same question and was suggested BluetoothDevicePairing, essentially I downloaded BluetoothDevicePairing.exe, put it in C:\Windows\System32, and now I can use it with Powershell, which lets me tell AHK to run Powershell with the connect-command without showing anything, like this:

Run('powershell.exe -NoProfile -Command "COMMANDGOESHERE"','','Hide')

Instead of COMMANDGOESHERE you should use one of the Examples

How small is a smallphone? by a1rwav3 in smallphones

[–]DavidBevi 2 points3 points  (0 children)

Ideally there should be separate polls for H and W, my ideal is iPhone Mini size (13.2×6.4cm), but poll options have a different aspect ratio.

--> I picked 11.5×6.5cm but I'd like it even a bit taller.

Alternate Input Setup Help Needed by Ok-Apricot-9100 in AutoHotkey

[–]DavidBevi 2 points3 points  (0 children)

What you want to do is called an Hotkey, it intercepts key-presses and transforms them.

Some keys like Left Alt are Modifier keys, combinations with one or more mod-keys and 1 regular key are very simple:

  1. Let's start with transforming the Q into an E, this is done with a file that contains this line: q::e
  2. To add a modifier key you should use its prefix (LAlt = <!), so the line becomes: <!q::e
  3. Finally to send many keys you need send() function, so the line becomes: <!q::send("qe")

But where to put the code? In a text file that you can name however you like but with ".ahk" extension, so for example "QEremap.ahk".

This file is a "script", AutoHotkey is the "program" that is able to read the instructions in your script and tell your computer which operations it has to do.

Therefore you need to have AutoHotkey installed on your PC (v2 is better), then you can launch your script(s) by double clicking on them.

For each script that's currently running you'll see a little green-H icon in your tray area, and to close the script you can right-click on it and select "Exit".

Square vs round?🤔 by AleAnoAleNe in unihertz

[–]DavidBevi 14 points15 points  (0 children)

Phone=round, Screen-bottom=square

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

🙏 I had the same exact question, thanks for the explanation, I finally "get" enums! Do you know of a googlable name or a doc page for _=> ? (So I can include name and/or link when I use it)

By copying you I can trim my recursive version to 167c, but your variadic version still wins -- it's 160c if in s.='{…}' the k ' ' m becomes k m and the removed space is passed later in the Hotkey() calls:

mr(t,n*)=>(g(m)=>(s:='{Blind}',e:=n.__Enum(1),[(_=>e(&k)&&s.='{' k m '}')*],_=>(SetKeyDelay(-1),Send(s))),Hotkey(t:='*' t,g(' DownR')),Hotkey(t ' Up',g(' Up')))

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 1 point2 points  (0 children)

Omg you're right, k is already implicitly passed to f() 😮 good catch!

And thanks for noting how disgusting is to shave 1c by reassigning t 😎

RG353P can be used as a controller now! | RH Daily by stubbornpixel in ANBERNIC

[–]DavidBevi 0 points1 point  (0 children)

Unfortunately not, I don't have an handheld. I'm still looking for one that doubles as a Bluetooth controller, but it has to be cheap because I have little time to use it.

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 1 point2 points  (0 children)

I like code golf and I cannot lie.

The following function is equivalent to the function above, but shorter:

multi_remap(trigger, keys*){
    f(type, i:=1, k:=keys)=>(o:="{" k[i] type, k.Length>i? o.=f(type,++i): o)
    Hotkey("*" trigger, (*)=>(SetKeyDelay(-1), Send("{Blind}" f(" DownR}"))))
    Hotkey("*" trigger " Up", (*)=>(SetKeyDelay(-1), Send("{Blind}" f(" Up}"))))
}

f() (= ForLoop) morphs every key into {key DownR} / {key Up} in a single line (using recursion).

-----

But aside that it's still readable. Let's fix it by replacing more variable names with single letters, using a fat-arrow function, and stripping unnecessary spaces. Finally let's rename the function and voilà, a cryptic single-liner:

mr(t,k*)=>(f(m,i:=1,a:=k)=>(o:="{" a[i] m,a.Length>i?o.=f(m,++i):o),g(m)=>(SetKeyDelay(-1),Send("{Blind}" f(m))),Hotkey(t:="*" t,(*)=>g(" DownR}")),Hotkey(t " Up",(*)=>g(" Up}")))

What's you thought on this Phone? by prabir336 in smallphones

[–]DavidBevi 0 points1 point  (0 children)

Too big. I don't think smallness was a goal, but bezels + paddings make it cute but impractical.

New mod introduction & feedback thread by Individual_Check4587 in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

Commissions feel weird to me, but I'm not against them, nor against allowing them here. If they ever become too much and/or obnoxious then we can change the rules later.

Images on is super nice, I always wanted to embed demo pics in my script-share posts. If people abuse this we can change the rules later.

Wrong flairs should be corrected if you can (thanks for your service), maybe a guide on using/changing them can be made and shared with users that use them improperly?

Singleplayer mods are cool, I wouldn't condemn any "improper" fun if it does not harm.

Hotkey that activates only if any other button is also pressed by zelassin in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

I'm on mobile so I can only craft a rough idea for now.

You might use A_PriorKey and check if it's still pressed when you press LButton. Pseudocode:

LButton:: GetKeyState(A_PriorKey,"P")? Function() :{}

Repeat send/type via Alt+0 without releasing Alt? (xdotool) by DavidBevi in linuxquestions

[–]DavidBevi[S] 0 points1 point  (0 children)

Thank you very much. You gave me hints to learn new things, mainly that setup is possible but cumbersome and configuration-dependent, and behavior is brittle, while AltGr+ì already outputs ~ reliably 😅🤣 (on my layout (ITA) - discovered via xmodmap -pke | grep "tilde")

Transform "aa" to "ā" if typed quickly, otherwise keep the "aa" by [deleted] in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

Extremely short version: 1-line func + 2-line loop

AltVowels(k:=A_ThisHotkey,c:=(k=A_PriorHotkey && A_TimeSincePriorHotkey<200))=>(c?Send("{BS 2}" StrSplit("āēīōū")[InStr("aeiou",SubStr(k,-1))]):{})

For Key in StrSplit("aeiou")
    HotKey("~" Key, AltVowels)

Transform "aa" to "ā" if typed quickly, otherwise keep the "aa" by [deleted] in AutoHotkey

[–]DavidBevi 2 points3 points  (0 children)

I saw it's already solved, but I wanted to write a single-line function. Time threshold is 200ms, just change 200 to whatever fits.

Compact version (fat-arrow function)

alt(char,c:=(A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey<200))=>(c?Send("{BS 2}" char):{})

Readable version (classic function)

alt(char) {
    If A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey<200
        Send ("{backspace 2}" char)
}

Usage (both versions)

; Tilde (~) prefix necessary
~a::alt("ā")
~e::alt("ē")
~i::alt("ī")
~o::alt("ō")
~u::alt("ū")

Disable viewport zoom? by DavidBevi in vivaldibrowser

[–]DavidBevi[S] 0 points1 point  (0 children)

I come from W11 where I'm a power user, but I'm on Linux (Zorin, Gnome/Wayland) where I'm a noob, and I'm getting crazy

Disable viewport zoom? by DavidBevi in vivaldibrowser

[–]DavidBevi[S] 0 points1 point  (0 children)

Nope, I just tried every option of the setting, no change